Page MenuHomePhabricator

Fix self member reference rule for PHP 5.3
ClosedPublic

Authored by joshuaspence on Aug 7 2015, 4:21 AM.
Tags
None
Referenced Files
F13182635: D13820.diff
Fri, May 10, 12:28 AM
Unknown Object (File)
Tue, May 7, 7:21 AM
Unknown Object (File)
Fri, May 3, 6:00 AM
Unknown Object (File)
Thu, Apr 25, 1:00 AM
Unknown Object (File)
Wed, Apr 17, 3:13 PM
Unknown Object (File)
Tue, Apr 16, 5:02 AM
Unknown Object (File)
Thu, Apr 11, 6:48 AM
Unknown Object (File)
Wed, Apr 10, 5:29 PM
Subscribers

Details

Summary

Fixes T8674. Currently, ArcanistSelfMemberReferenceXHPASTLinterRule warns if a fully-qualified class name is used in place of self. This is fine in most cases, but in some specific scenarios fails for PHP 5.3 because self (and also $this) cannot be used in an anonymous closure (see anonymous functions and [[https://wiki.php.net/rfc/closures/removal-of-this | removal of $this in closures]]).

In order to do this, I also had to modify the manner in which configuration was passed to individual linter rule. Previously, it was only possible or an individual linter rule to be set with a configuration value. Once the linter rule had set this value, there was no means by which to allow this value to be shared amongst linter rules.

Depends on D13819.

Test Plan

Added unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 7548
Build 8136: [Placeholder Plan] Wait for 30 Seconds
Build 8135: arc lint + arc unit

Event Timeline

joshuaspence retitled this revision from to Fix self member reference rule for PHP 5.3.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Aug 7 2015, 11:02 AM

Move the getAnonymousClosures method to ArcanistXHPASTLinterRule

This revision was automatically updated to reflect the committed changes.