Page MenuHomePhabricator

Add a linter rule for `abstract private` methods
ClosedPublic

Authored by joshuaspence on Nov 23 2015, 8:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 15, 9:37 AM
Unknown Object (File)
Sun, Sep 15, 9:36 AM
Unknown Object (File)
Sun, Sep 15, 9:25 AM
Unknown Object (File)
Sun, Sep 15, 9:25 AM
Unknown Object (File)
Fri, Sep 13, 4:33 PM
Unknown Object (File)
Fri, Sep 13, 12:47 PM
Unknown Object (File)
Fri, Sep 13, 1:41 AM
Unknown Object (File)
Wed, Sep 4, 6:35 PM
Subscribers

Details

Summary

Methods cannot be marked as both abstract and private. This language construct will cause a fatal error:

PHP Fatal error:  Abstract function X::Y() cannot be declared private in /home/josh/workspace/github.com/phacility/arcanist/test.php on line 4
Test Plan

Added unit tests.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for `abstract private` methods.
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.Nov 23 2015, 8:28 PM

We could, of course, build this into the language definition itself, but I think that this will make a huge mess. Its also be rt of nice that we can parse almost-valid PHP for the purposes of syntax highlighting, as an example.

This revision was automatically updated to reflect the committed changes.