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)
Thu, Feb 13, 8:47 PM
Unknown Object (File)
Sat, Feb 8, 3:09 AM
Unknown Object (File)
Mon, Feb 3, 4:25 AM
Unknown Object (File)
Sat, Feb 1, 8:29 PM
Unknown Object (File)
Wed, Jan 29, 10:36 PM
Unknown Object (File)
Wed, Jan 29, 10:35 PM
Unknown Object (File)
Mon, Jan 27, 5:49 PM
Unknown Object (File)
Sun, Jan 19, 10:56 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.