Skip to content

Commit f62bb57

Browse files
Update README.md
Removing $ to make copying the command easier
1 parent 1900302 commit f62bb57

File tree

1 file changed

+33
-32
lines changed

1 file changed

+33
-32
lines changed

README.md

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ php phpcbf.phar -h
3333

3434
### Composer
3535
If you use Composer, you can install PHP_CodeSniffer system-wide with the following command:
36-
37-
composer global require "squizlabs/php_codesniffer=*"
38-
36+
```bash
37+
composer global require "squizlabs/php_codesniffer=*"
38+
```
3939
Make sure you have the composer bin dir in your PATH. The default value is `~/.composer/vendor/bin/`, but you can check the value that you need to use by running `composer global config bin-dir --absolute`.
4040

4141
Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your `composer.json` file. For example:
@@ -49,47 +49,48 @@ Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your `
4949
```
5050

5151
You will then be able to run PHP_CodeSniffer from the vendor bin directory:
52-
53-
./vendor/bin/phpcs -h
54-
./vendor/bin/phpcbf -h
55-
52+
```bash
53+
./vendor/bin/phpcs -h
54+
./vendor/bin/phpcbf -h
55+
```
5656
### Phive
5757
If you use Phive, you can install PHP_CodeSniffer as a project tool using the following commands:
58-
59-
phive install phpcs
60-
phive install phpcbf
61-
58+
```bash
59+
phive install phpcs
60+
phive install phpcbf
61+
```
6262
You will then be able to run PHP_CodeSniffer from the tools directory:
63-
64-
./tools/phpcs -h
65-
./tools/phpcbf -h
66-
63+
```bash
64+
./tools/phpcs -h
65+
./tools/phpcbf -h
66+
```
6767
### PEAR
6868
If you use PEAR, you can install PHP_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf` commands immediately available for use. To install PHP_CodeSniffer using the PEAR installer, first ensure you have [installed PEAR](http://pear.php.net/manual/en/installation.getting.php) and then run the following command:
69-
70-
pear install PHP_CodeSniffer
71-
69+
```bash
70+
pear install PHP_CodeSniffer
71+
```
7272
### Git Clone
7373
You can also download the PHP_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone:
74-
75-
git clone https://github.com/squizlabs/PHP_CodeSniffer.git
76-
cd PHP_CodeSniffer
77-
php bin/phpcs -h
78-
php bin/phpcbf -h
79-
74+
```bash
75+
git clone https://github.com/squizlabs/PHP_CodeSniffer.git
76+
cd PHP_CodeSniffer
77+
php bin/phpcs -h
78+
php bin/phpcbf -h
79+
```
8080
## Getting Started
8181

8282
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:
83-
84-
$ phpcs /path/to/code/myfile.php
85-
83+
```bash
84+
phpcs /path/to/code/myfile.php
85+
```
8686
Or if you wish to check an entire directory you can specify the directory location instead of a file.
87-
88-
$ phpcs /path/to/code-directory
89-
87+
```bash
88+
phpcs /path/to/code-directory
89+
```
9090
If you wish to check your code against the PSR-12 coding standard, use the `--standard` command line argument:
91-
92-
$ phpcs --standard=PSR12 /path/to/code-directory
91+
```bash
92+
phpcs --standard=PSR12 /path/to/code-directory
93+
```
9394

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

0 commit comments

Comments
 (0)