danwdart / projectchaplin

Free and Open Source Video Sharing Platform
GNU Affero General Public License v3.0
24 stars 11 forks source link

better phpcs #197

Open danwdart opened 6 years ago

danwdart commented 6 years ago

Better PHPCS

Use a newer standard and more sniffs so we can detect and auto-fix things like:

PSR-1: http://www.php-fig.org/psr/psr-1/ PSR-2: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md

danwdart commented 6 years ago

Seems that PSR1, PSR2, SlevomatCodingStandard and Squiz includes most of the things here. Except:

protect against backtick operator protect against raw SQL everywhere if poss. Test files' public methods' names should only begin with "test" Common class names are only in "use" statements and are not littered about classes Everything is NS'd (& exceptions are logged) Duplicate code is all in mixins mocks are named/unambiguous/etc

danwdart commented 6 years ago

Many of these conflict with existing standards trees, would be better to find an interactive chooser so that none of the overrides clash with each other.