Traits do not seem to load properly in classes #942
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
Dependencies
No dependencies set.
Reference: joomla/Component-Builder#942
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps to reproduce the issue
Expected result
$helper = new Umhelper(); echo '<pre>'; var_dump(class_uses($helper)); die;
array(1) { ["VDM\Joomla\Utilities"]=> string(20) "VDM\Joomla\Utilities" }
Actual result
Instead result is
array(0){}
If i move the use of utilities inside the class and add a backslash it works
Then using class_uses($helper) results in
array(1) { ["VDM\Joomla\Utilities"]=> string(20) "VDM\Joomla\Utilities" }
System information (as much as possible)
Additional comments
Using my own created traits results in the same behaviour as mentioned above. I haven't used traits in a while so if i'm doing something wrong here i would not be surprised.
Please upgrade your Plugins, as I can see your still on an older version of the header plugins. This is how it should look like:
Let me know once you have all upgrade, your still having this issue.
I re-downloaded the JCB package and confirmed that all the plugins are the same version as the ones in your link but I may not have been clear. The first image is a screenshot from inside the Umhelper class in the powers area. When i look inside an admin view tab 'class headers' i see the following:
I just realize what the issue is here, JCB does not yet add the trait to the class, it only addes it as use namespace (auto loader) to the header of the file.
But I can understand that this behaviour your looking for is what whould be naturally expected. So lets add this issue as a feature request and add this automation in, so JCB will add the trait to the class code ready to use... if it detects that you have not done so already.