You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 29, 2020. It is now read-only.
If you attempt to include multiple traits across multiple use statements within a class, it will not be picked up by ClassScanner. This can be easily verified by modifying test/TestAsset/TestClassUsesTraitSimple.php and modifying it to use two use statements, one for each trait, rather than all in one use statement as it is now. It's worth noting that it doesn't appear to matter how many use statements there are, it will only ever record the traits available in the first statement.
I tried looking into why this was happening, but unfortunately the most sophisticated debugging tools I have available to me at the moment are echo and var_dump. From what I can tell, the parser does find the other use statements, and is even able to work out what the class name is, but it never ends up permanently in $this->infos.
The text was updated successfully, but these errors were encountered:
Okay, I finally worked out what was going wrong. There are break statements at the end of the main foreach loops in all of the following methods:
getTraitNames()
getTraitAliases()
getVisibilityForAlias()
getBlockedTraitMethods()
I can't fathom why they would be there, but they've been there since the code was first committed and released. The result is that once the code finds the first use statement, it terminates. Unless I'm missing something, I should be able to remove them.
There is also a break 2 statement inside the nested foreach loop in getVisibilityForAlias(). I don't know enough about the purpose of the method to understand if that should be left alone, but my inclination is yes.
If you attempt to include multiple traits across multiple
use
statements within a class, it will not be picked up byClassScanner
. This can be easily verified by modifyingtest/TestAsset/TestClassUsesTraitSimple.php
and modifying it to use twouse
statements, one for each trait, rather than all in oneuse
statement as it is now. It's worth noting that it doesn't appear to matter how manyuse
statements there are, it will only ever record the traits available in the first statement.I tried looking into why this was happening, but unfortunately the most sophisticated debugging tools I have available to me at the moment are
echo
andvar_dump
. From what I can tell, the parser does find the otheruse
statements, and is even able to work out what the class name is, but it never ends up permanently in$this->infos
.The text was updated successfully, but these errors were encountered: