Page MenuHomePhabricator

Explicitly enumerate PHP magic methods
ClosedPublic

Authored by joshuaspence on Sep 22 2014, 9:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 21, 3:27 PM
Unknown Object (File)
Tue, Jan 21, 12:43 PM
Unknown Object (File)
Mon, Jan 20, 12:03 PM
Unknown Object (File)
Mon, Jan 20, 12:03 PM
Unknown Object (File)
Mon, Jan 20, 1:20 AM
Unknown Object (File)
Fri, Jan 17, 2:52 PM
Unknown Object (File)
Fri, Jan 17, 2:34 AM
Unknown Object (File)
Fri, Dec 27, 6:25 PM
Subscribers

Details

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 }

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Explicitly enumerate PHP magic 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.Sep 22 2014, 9:56 PM
This revision was automatically updated to reflect the committed changes.