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.

Bug 247082 - No support for $this, self etc. within a closure
Summary: No support for $this, self etc. within a closure
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-12 20:07 UTC by TheTechFan
Modified: 2016-06-15 01:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Demonstrates the bug (632 bytes, application/octet-stream)
2014-09-12 20:12 UTC, TheTechFan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TheTechFan 2014-09-12 20:07:22 UTC
Product Version = NetBeans IDE 8.0.1 (Build 201408251540)
Operating System = Windows Server 2012 version 6.2 running on amd64
Java; VM; Vendor = 1.8.0_20
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.20-b23

See attached testcase
Comment 1 TheTechFan 2014-09-12 20:12:10 UTC
Created attachment 149182 [details]
Demonstrates the bug
Comment 2 Tomas Mysik 2016-06-10 10:35:51 UTC
Reproducible. Thanks for reporting.
Comment 3 Tomas Mysik 2016-06-13 08:06:55 UTC
IMHO this is a new feature of PHP (5.4?) where inside anonymous functions, one can use "self" and "$this" whithout defining them in use() part of the anonymous function declaration.
Comment 4 Tomas Mysik 2016-06-13 08:30:31 UTC
That also means that there is no code-completion after $this and self.
Comment 5 Tomas Mysik 2016-06-13 12:05:12 UTC
One more special case - "parent".
Comment 6 Tomas Mysik 2016-06-14 13:32:42 UTC
Should be fixed now, please verify (find usages, code completion). Thanks.

http://hg.netbeans.org/web-main/rev/5cb225a15d00
http://hg.netbeans.org/web-main/rev/faa6757992af
http://hg.netbeans.org/web-main/rev/1a5cc7cdcd1b
Comment 7 Quality Engineering 2016-06-15 01:53:29 UTC
Integrated into 'main-silver', will be available in build *201606150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/5cb225a15d00
User: Tomas Mysik <tmysik@netbeans.org>
Log: #247082 - Calls to a static method within a closure can't be refactored

Mark occurrences fixed now.