https://github.com/deprecated-packages/php7_codesniffer
[DEPRECATED] Use:
https://github.com/deprecated-packages/php7_codesniffer
codesniffer coding-standard deprecated php-code-sniffer
Last synced: 23 days ago
JSON representation
[DEPRECATED] Use:
- Host: GitHub
- URL: https://github.com/deprecated-packages/php7_codesniffer
- Owner: deprecated-packages
- License: mit
- Created: 2016-07-28T13:29:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-17T10:56:11.000Z (about 9 years ago)
- Last Synced: 2023-07-26T15:40:14.285Z (over 2 years ago)
- Topics: codesniffer, coding-standard, deprecated, php-code-sniffer
- Language: PHP
- Homepage: https://github.com/Symplify/EasyCodingStandard
- Size: 191 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CodeSniffer in PHP 7, with simple usage everyone understands
This is essential development tool that ensures your code **remains clean and consistent**.
[](https://travis-ci.org/Symplify/PHP7_CodeSniffer)
[](https://scrutinizer-ci.com/g/Symplify/PHP7_CodeSniffer)
[](https://scrutinizer-ci.com/g/Symplify/PHP7_CodeSniffer)
[](https://packagist.org/packages/symplify/php7_codesniffer)
[](https://packagist.org/packages/symplify/php7_codesniffer)
## Install
```bash
composer require symplify/php7_codesniffer --dev
```
## Use
Run it from cli:
```bash
vendor/bin/php7cs src --standards=PSR2
```
To fix the issues just add `--fix`:
```bash
vendor/bin/php7cs src --standards=PSR2 --fix
```
### How to Use Specific Sniff Only?
```bash
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:
```bash
vendor/bin/php7cs src --standards=PSR2 --sniffs=Zend.Files.ClosingTag
```
### Or Use Standard WITHOUT One Sniff?
```bash
vendor/bin/php7cs src --standards=PSR2 --exclude-sniffs=PSR2.Namespaces.UseDeclaration
```
## Testing
```bash
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.