I am reading M. Zandstra’s book "PHP. Objects, Patterns, and Programming Techniques" and sketching a test example, I decided to build his UML diagram in PHPStorm. In the PHPStorm menu, I found the corresponding functionality in the menu: when I click on a file, I right-click the context menu of this file -> Diagrams -> Show Diagram.
for the following code:
interface red {} class primary implements red { private $moon; function __construct( composcl $moon){ $this->moon = $moon; } public function fokkd() { return $this->moon->catg($this); } public function getfstr() :string { return " First root class"; } } class childone extends primary { } class childtwo extends primary { } class composcl { public function catg( primary $obj) :string { return "Delegation in use: ".$obj->getfstr(); } } $obj = new primary( new composcl() ); echo $obj->fokkd(); But why is the composition not marked? (a filled diamond going from the primary class to the composcl class). Indeed, in the primary class there is a permanent link to an instance of the composcl class. PHPStorm does not draw full UML? Or is there an error in my code? What program or service can I scan a project and build a full UML diagram for it?
