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.
### Steps to reproduce the issue
1) Create Class (in my case Umhelper) in powers area of JCB
2) Load 'Utilities' trait into class (one of the items that are imported when you load the powers into JCB)

3) the traits gets added to the use list

### Expected result
1) checking what traits are used using the code
` $helper = new Umhelper();
echo '<pre>';
var_dump(class_uses($helper));
die;
`
2) Result should be
`array(1) {
["VDM\Joomla\Utilities"]=>
string(20) "VDM\Joomla\Utilities"
}`
### Actual result
1) Instead result is
`array(0){}`
2) 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)
- OS Name & Version:
- MySql Version:
- Apache Version:
- PHP Version: 7.4
- Joomla Version: 3.10.10
- JCB Version: 3.1.4
- Browser: Firefox
### 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.
Please [upgrade your Plugins](https://git.vdm.dev/joomla/pkg-component-builder), 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 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.
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.
Llewellyn
added this to the Major improvement to core (speedup production) milestone 2022-08-03 08:54:54 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.