Skip to content

Commit

Permalink
Added simple usage information to the README (ref squizlabs#2583, squ…
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood authored Aug 13, 2019
1 parent b2c1546 commit 74ff74d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,24 @@ You can also download the PHP_CodeSniffer source and run the `phpcs` and `phpcbf
php bin/phpcs -h
php bin/phpcbf -h

## Getting Started

The default coding standard used by PHP_CodeSniffer is the PEAR coding standard. To check a file against the PEAR coding standard, simply specify the file's location:

$ phpcs /path/to/code/myfile.php

Or if you wish to check an entire directory you can specify the directory location instead of a file.

$ phpcs /path/to/code-directory

If you wish to check your code against the PSR-2 coding standard, use the `--standard` command line argument:

$ phpcs --standard=PSR2 /path/to/code-directory

If PHP_CodeSniffer finds any coding standard errors, a report will be shown after running the command.

Full usage information and example reports are available on the [usage page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Usage).

## Documentation

The documentation for PHP_CodeSniffer is available on the [Github wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
Expand Down

0 comments on commit 74ff74d

Please sign in to comment.