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)
Sep 18 2024, 2:00 PM
Unknown Object (File)
Sep 4 2024, 5:30 AM
Unknown Object (File)
Sep 3 2024, 11:02 AM
Unknown Object (File)
Aug 31 2024, 10:22 PM
Unknown Object (File)
Aug 29 2024, 1:36 PM
Unknown Object (File)
Aug 29 2024, 4:58 AM
Unknown Object (File)
Aug 28 2024, 3:24 PM
Unknown Object (File)
Aug 24 2024, 2:50 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.