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
F14029190: D14558.id.diff
Fri, Nov 8, 7:57 PM
F14029189: D14558.diff
Fri, Nov 8, 7:57 PM
F14025884: D14558.diff
Thu, Nov 7, 9:00 PM
F14004008: D14558.id35222.diff
Sat, Oct 26, 2:05 PM
F13998017: D14558.diff
Thu, Oct 24, 7:15 AM
F13995946: D14558.id35222.diff
Wed, Oct 23, 4:53 PM
F13980279: D14558.diff
Sat, Oct 19, 9:29 AM
F13980265: D14558.id.diff
Sat, Oct 19, 9:26 AM
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.