Skip to content

amesplash/php-coding-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

amésplash Coding Standard

The amésplash coding standard definition for PHP_CodeSniffer used at amésplash. Our coding standard is heavily based on Slevomat Coding Standard and Doctrine Coding Standard.

$ php composer require --dev amesplash/php-coding-standard

You now use it to sniff your files like below:

$ ./vendor/bin/phpcs --standard=Amesplash /path/to/file/or/folder/to/sniff.php

Or to do automatic fixes using phpcbf like below:

$ ./vendor/bin/phpcbf --standard=Amesplash /path/to/file/or/folder/to/fix.php

Per project ruleset

To enable the amésplash coding standard for your project, create a phpcs.xml.dist file with the following content:

<?xml version="1.0"?>
<ruleset>
    <arg name="basepath" value="."/>
    <arg name="extensions" value="php"/>
    <arg name="parallel" value="80"/>
    <arg name="cache" value=".phpcs-cache"/>
    <arg name="colors"/>

    <!-- Ignore warnings, show progress of the run and show sniff names -->
    <arg value="nps"/>

    <!-- Directories to be checked -->
    <file>src</file>

    <!-- Reference the amésplash coding standard -->
    <rule ref="Amesplash"/>
</ruleset>

About

The amésplash PHP coding standard

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages