]> khamidou — GitHub mirrors - arcanist.git/commit
Explicitly enumerate PHP magic methods
authorJoshua Spence <josh@joshuaspence.com>
Mon, 22 Sep 2014 22:02:19 +0000 (08:02 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Mon, 22 Sep 2014 22:02:19 +0000 (08:02 +1000)
commita70a00a960ff4a7e30e20b4db1c68c081f16eaa0
treef6685fec2a3c0ed2ae202eacc1403fcb2468a685
parent670dccee47aa8ad65619950fb33b08d410da9579
Explicitly enumerate PHP magic methods

Summary: Explicitly list PHP magic methods (methods beginning with `__`) instead of assuming that //all// methods beginning with `__` are okay in terms of naming conventions. These magic methods were obtained from http://us1.php.net/manual/en/language.oop5.magic.php.

Test Plan:
```
   Warning  (XHP9) Naming Conventions
    Follow naming conventions: methods should be named using lowerCamelCase.

               1 <?php
               2
               3 class Foo {
    >>>        4     function __foo() {}
               5
               6     function _bar() {}
               7 }

   Warning  (XHP9) Naming Conventions
    Follow naming conventions: methods should be named using lowerCamelCase.

               3 class Foo {
               4     function __foo() {}
               5
    >>>        6     function _bar() {}
               7 }
```

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10539
src/lint/linter/xhpast/ArcanistXHPASTLintNamingHook.php