Skip to content

fws-solutions/php-coding-standards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forwardslash PHP Coding Standards

Install

To install in your project, use:

composer require fws/php-coding-standards --dev

Then add a phpcs.xml file to your project:

<?xml version="1.0"?>
<ruleset name="Project">
    <rule ref="FWS"/>
</ruleset>

To do this quickly, run:

echo '<?xml version="1.0"?><ruleset name="Project"><rule ref="FWS"/></ruleset>' > phpcs.xml

Installation will automatically install Forwardslash standard for vendor/bin/phpcs.

CLI Linting

Lint a single file

./vendor/bin/phpcs -s path/to/file.php

Lint multiple files

./vendor/bin/phpcs -s --extensions=php /path/to/dir

Editor Linting

In your favorite editor install it's phpcs plugin, and it will automatically detect your phpcs.xml file and lint any PHP file you have open.

About

Forwardslash PHP Coding Standards

Resources

Stars

Watchers

Forks

Packages

No packages published