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.
Scope resolution operator (::) could be used with object it self. So, it could be autocompleted by static and constant. ini_set('error_reporting', -1); ini_set('display_errors', 1); class SomeClass { const SOME_CONSTANT = 'some constant'; static public $some_member = 'some member'; static public function someFunction(){} } $object = new SomeClass(); $object::SOME_CONSTANT; $object::$some_member; $object::someFunction(); There is should be an autocompletion list with SOME_CONSTANT, $some_member and someFunction() after :: operator.
*** Bug 251447 has been marked as a duplicate of this bug. ***
*** Bug 253274 has been marked as a duplicate of this bug. ***
Created attachment 157777 [details] patch I just comment out one test case[1] because I'm not sure whether it should be removed completely. [1] test/unit/src/org/netbeans/modules/php/editor/completion/PHPCodeCompletionTest.java : test146648() Thanks.
Created attachment 157792 [details] patch Array case is missing. Thanks.
Created attachment 157869 [details] patch Minor change. Thanks.
@Tomas, Could you please review it (when you can make time) ? I wrote echo statements in the PHP test file to confirm whether we can run the code actually. If it's not good, I'll remove them. Thanks.
(In reply to sectus from comment #0) > $object::SOME_CONSTANT; > $object::$some_member; > $object::someFunction(); I have to say that personally I strongly prefer to use SomeClass::___ and not an instance since static members belongs to the class, not its instance. But I will apply the patch. Thanks a lot for it, Junichi!
(In reply to junichi11 from comment #6) > I wrote echo statements in the PHP test file to confirm whether we can run > the code actually. If it's not good, I'll remove them. Junichi, how do you verify that the code runs without any problem? Thanks.
(In reply to Tomas Mysik from comment #8) > (In reply to junichi11 from comment #6) > > I wrote echo statements in the PHP test file to confirm whether we can run > > the code actually. If it's not good, I'll remove them. > > Junichi, how do you verify that the code runs without any problem? I just run `php issue240527.php` manually.
Patch applied, thanks a lot for it, Junichi! Junichi, one idea related to this change: +// This is valid since PHP 5.3.0. Fixed in #240527 +// public void test146648() throws Exception { Perhaps we could add a hint for it? OTOH, not sure if it is worth since older versions of PHP are today basically not used anymore... Thanks! http://hg.netbeans.org/web-main/rev/09316766795d
Tomas, thanks a lot for reviewing it! (In reply to Tomas Mysik from comment #10) > Perhaps we could add a hint for it? OTOH, not sure if it is worth since > older versions of PHP are today basically not used anymore... I'll try it. But I also think so... Thanks!
Integrated into 'main-silver', will be available in build *201601090002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/09316766795d User: Tomas Mysik <tmysik@netbeans.org> Log: #240527 - Autocomplete for object with scope resolution operator Patch contributed by junichi11@netbeans.org.