[Uml-devel] kdesdk/umbrello/umbrello/codegenerators
Oliver Kellogg
okellogg at users.sourceforge.net
Fri Oct 1 19:45:19 UTC 2004
CVS commit by okellogg:
Patch by Thorsten Kunz fixes code for multiple interface realization.
M +6 -3 php5writer.cpp 1.4
--- kdesdk/umbrello/umbrello/codegenerators/php5writer.cpp #1.3:1.4
@@ -121,8 +121,11 @@ void Php5Writer::writeClass(UMLClassifie
if( !realizations.isEmpty()) {
int rc = realizations.count();
+ int ri = rc;
for (a = realizations.first(); a; a = realizations.next()) {
UMLObject *o = m_doc->findObjectById(a->getRoleId(Uml::B));
QString typeName = cleanName(o->getName());
- php << m_newLineEndingChars << m_indentation << m_indentation << m_indentation << "implements " << typeName << (--rc == 0 ? "" : ",");
+ if(ri == rc)
+ php << m_newLineEndingChars << m_indentation << m_indentation << m_indentation << "implements ";
+ php << typeName << (--rc == 0 ? "" : ", ");
}
}
@@ -285,5 +288,4 @@ void Php5Writer::writeOperations(QString
php << m_indentation;
if (op->getAbstract()) php << "abstract ";
- if (op->getStatic()) php << "static ";
switch(op->getScope()) {
case Uml::Public:
@@ -297,4 +299,5 @@ void Php5Writer::writeOperations(QString
break;
}
+ if (op->getStatic()) php << "static ";
php << "function " << cleanName(op->getName()) << "(";
@@ -380,5 +383,4 @@ void Php5Writer::writeAttributes(UMLAttr
}
php << m_indentation;
- if(isStatic) php << "static ";
switch(at->getScope()) {
case Uml::Public:
@@ -392,4 +394,5 @@ void Php5Writer::writeAttributes(UMLAttr
break;
}
+ if(isStatic) php << "static ";
php << "$" << cleanName(at->getName());
if(!at->getInitialValue().isEmpty())
More information about the umbrello-devel
mailing list