aik099 / CodingStandard

The PHP_CodeSniffer coding standard I'm using on all of my projects
BSD 3-Clause "New" or "Revised" License
5 stars 2 forks source link

Create keyword order for class/method #34

Open aik099 opened 10 years ago

aik099 commented 10 years ago

Ensure that keywords abstract, final, static, public/protected/private are used in following order:

[abstract] [final] public/protected/private [static]

This applies to classes, traits, methods and class/trait properties.

Error message from PHP-CS-Fixer: Visibility MUST be declared on all properties and methods; abstract and final MUST be declared before the visibility; static MUST be declared after the visibility. (see https://github.com/fabpot/PHP-CS-Fixer/blob/54b01c018bffe3ed20d1e138f2bc885597c59f50/Symfony/CS/Fixer/PSR2/VisibilityFixer.php).

I think there are sniffs already that checks for private/protected/public presence, so here we just need to assert their order.