MontealegreLuis / phuml

phUML is a UML diagram generator. It takes arbitrary object oriented PHP code and creates fully blown class diagrams of it.
BSD 3-Clause "New" or "Revised" License
100 stars 19 forks source link

How phUML handles arrays - UML syntax #31

Open cth027 opened 7 months ago

cth027 commented 7 months ago

phUML tries to use the more specific type of the classes stored in an array, as explained here. The notation ClassDefinition[] is however not valid UML and ClassDefinition[*] should be preferred according to UML syntax for multiplicity (see UML 2.5.1 specifications on the OMG website, chapter 7.5.4.1). Likewise, if no such specific class is found, phUML seems to use array which hides somewhat the multiplicity in the UML diagram. Using mixed[*] , in view of PHP type documentation, would allow to remain compliant with PHP semantics (freedom to put anything in an array) and UML.