Closed Amegatron closed 2 years ago
Hi @Amegatron you're absolutely right that's the line with the issue, and the solution is the one you suggested.
This test case is missing one entry with a class with a namespace: https://github.com/MontealegreLuis/phuml/blob/master/tests/unit/Code/Variables/TypeDeclarationTest.php#L107
This is a good first issue for anyone looking to start contributing to phUML.
Fixed in #19
In union types, FQN of it's components is lost when getting their
referecnes()
. For example, if I have a class property (attribute) with typeMy\Intersting\SuperType|null
,references()
will return type justSuperType
with the rest part of FQN truncated.I believe this is because of this line: https://github.com/MontealegreLuis/phuml/blob/master/src/Code/Variables/TypeDeclaration.php#L74
When casting
Name
to string, it uses only the last part of it. Not sure if it's inteded or not, but seems->fullName()
should be used there.