This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
If I have a two traits in different namespaces with the same name, the editor does not correctly determine the trait to use: it seems to go in alphabetical order rather than using the current namespace. Example: --- FILE 1 --- <?php namespace ns1; trait TestTrait { public abstract function foo(); } --- FILE 2 --- <?php namespace ns2; trait TestTrait { public abstract function bar(); } --- FILE 3 --- <?php namespace ns2; class TestClass { use TestTrait; public function bar() {} } The editor reports an error in file 3, that abstract function 'foo()' has not been defined. This seems to be because it is resolving the 'use TestTrait' statement as 'use ns1\TestTrait' rather than 'use ns2\TestTrait'. Trait names in a trait use statement are expressed relevant to the namespace of the class.
Taking over.
Unfortunately, this is very difficult to fix. Even if I fix the model part, the index part still (incorrectly in this case) uses both traits and there is no easy way to fix it (at least for now, at least for me). Attaching partial fix for model. Thanks for reporting.
Created attachment 160146 [details] Partial fix (for model) However, the index part is still broken.