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
Unknown Object (File)
Sat, Nov 23, 5:29 PM
Unknown Object (File)
Thu, Nov 21, 6:19 PM
Unknown Object (File)
Mon, Nov 11, 5:56 AM
Unknown Object (File)
Mon, Nov 11, 5:56 AM
Unknown Object (File)
Mon, Nov 11, 5:56 AM
Unknown Object (File)
Thu, Nov 7, 3:49 AM
Unknown Object (File)
Thu, Nov 7, 3:49 AM
Unknown Object (File)
Thu, Nov 7, 3:49 AM
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 7556
Build 8152: [Placeholder Plan] Wait for 30 Seconds
Build 8151: 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.