Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 1.84 KB

README.md

File metadata and controls

67 lines (44 loc) · 1.84 KB

CodeSniffer in PHP 7, with simple usage everyone understands

This is essential development tool that ensures your code remains clean and consistent.

Build Status Quality Score Code Coverage Downloads total Latest stable

Install

composer require symplify/php7_codesniffer --dev

Use

Run it from cli:

vendor/bin/php7cs src --standards=PSR2

To fix the issues just add --fix:

vendor/bin/php7cs src --standards=PSR2 --fix

How to Use Specific Sniff Only?

vendor/bin/php7cs src --sniffs=PSR2.Classes.ClassDeclaration
vendor/bin/php7cs src --sniffs=PSR2.Classes.ClassDeclaration,Zend.Files.ClosingTag

You can combine them as well:

vendor/bin/php7cs src --standards=PSR2 --sniffs=Zend.Files.ClosingTag

Or Use Standard WITHOUT One Sniff?

vendor/bin/php7cs src --standards=PSR2 --exclude-sniffs=PSR2.Namespaces.UseDeclaration

Testing

bin/php7cs src tests --standards=PSR2
vendor/bin/phpunit

Contributing

Rules are simple:

  • new feature needs tests
  • all tests must pass
  • 1 feature per PR

I'd be happy to merge your feature then.