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

Definition name cannot be null or empty #13

Closed theseer closed 2 years ago

theseer commented 2 years ago

When giving phuml a run against Templado (https://templado.io), phuml crashes with the following error:

theseer@nyda /tmp/x5 $ php ./tools/phuml phuml:diagram -r -p neato  ~/storage/php/templado/engine/src test.png
[|] Running... (This may take some time)
[|] Parsing codebase structure

In Assert.php line 2060:

  Definition name cannot be null or empty  

Not sure what to do here next :)

MontealegreLuis commented 2 years ago

Hi @theseer the problem is that using object in a DockBlock will return an Object_ but with null value.

I have fixed it in this MR https://github.com/MontealegreLuis/phuml/pull/15 if you want to give it a try.

I checked locally and I can generate diagrams for both Templado and Phive.

I found another issue after generating those diagrams with definitions like this one:

namespace PharIo\Phive;

class EnvironmentException extends \Exception implements Exception {
}

I usually alias the class instead of using the fully qualified name.

I'll open another MR with a fix for that

MontealegreLuis commented 2 years ago

Hi @theseer 5.2.1 should solve the issue with empty name and the issue mentioned in my previous comment.

theseer commented 2 years ago

Works. Thanks for the fix.