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.
Product Version: NetBeans IDE Dev (Build 201206040001) Java: 1.7.0_04; Java HotSpot(TM) 64-Bit Server VM 23.0-b21 System: Linux version 2.6.35.14-106.fc14.x86_64 running on amd64; UTF-8; en_US (nb) Hi, Traits allows you to adjust a method visibility. By now, CC shows both 2 methods publicly available ("getAnswer" and "getName"), but should return only one "getToken". <?php trait TheAbsoluteEssenceOfAll { public function getAnswer () { return 42; } public function getName () { return null; } protected function getToken () { return 'ABC'; } } class Universe { use TheAbsoluteEssenceOfAll { getAnswer as private; getName as protected; getToken as public; } } $uni = new Universe(); $uni-> +--------------------------------------+ | getAnswer() TheAbsoluteEssenceOfAll | | getName() TheAbsoluteEssenceOfAll | +--------------------------------------+
Nothing from "use traits block" wasn't implemented in this firts support implementation (which is in 7.2). All things are enhancements for 7.3 and later (adding aliased methods into CC, and such). It has been mentioned in blog post afaik. Thanks for your interrest.
By "use traits block" I mean that block part after use trait statement ;) Where conflicts are solved and such :)
Code inspector ignores implementation trait methods when class implements interface. Example: <?PHP interface DependencyInjection { public function _inject_dependencies(); } trait LazyInjector { public function _inject_dependencies() { ... } } class Configurator implements DependencyInjection ^^^^^^^^^^^^ -- IDE marks the class does not implement the method _inject_dependencies() { use LazyInjector;
EdmondX that issue is fixed in dev build.
Reproductible in 8.2rc / Dev 201609210002