You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-13
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,14 @@
1
-
About
2
-
-----
1
+
## About
3
2
4
3
PHP\_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP\_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
5
4
6
5
[](https://travis-ci.org/squizlabs/PHP_CodeSniffer)[](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer)[](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
7
6
8
-
Requirements
9
-
------------
7
+
## Requirements
10
8
11
9
PHP\_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements.
12
10
13
-
Installation
14
-
------------
11
+
## Installation
15
12
16
13
The easiest way to get started with PHP\_CodeSniffer is to download the Phar files for each of the commands:
17
14
@@ -21,7 +18,8 @@ The easiest way to get started with PHP\_CodeSniffer is to download the Phar fil
If you use Composer you can easily install PHP_CodeSniffer system-wide with the following command:
21
+
### Composer
22
+
If you use Composer, you can install PHP_CodeSniffer system-wide with the following command:
25
23
26
24
composer global require "squizlabs/php_codesniffer=*"
27
25
@@ -42,28 +40,38 @@ You will then be able to run PHP_CodeSniffer from the vendor bin directory:
42
40
./vendor/bin/phpcs -h
43
41
./vendor/bin/phpcbf -h
44
42
43
+
### Phive
44
+
If you use Phive, you can install PHP_CodeSniffer as a project tool using the following commands:
45
+
46
+
phive install phpcs
47
+
phive install phpcbf
48
+
49
+
You will then be able to run PHP_CodeSniffer from the tools directory:
50
+
51
+
./tools/phpcs -h
52
+
./tools/phpcbf -h
53
+
54
+
### PEAR
45
55
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:
46
56
47
57
pear install PHP_CodeSniffer
48
58
59
+
### Git Clone
49
60
You can also download the PHP\_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone:
0 commit comments