@@ -17,7 +17,7 @@ You can install the Doctrine Coding Standard as a plugin into your global system
1717
1818``` bash
1919$ cd /path/to/phpcs/CodeSniffer/Standards
20- $ git clone https://github.com/ doctrine/coding-standard.git Doctrine
20+ $ php composer create-project doctrine/coding-standard Doctrine ~ 0.1@dev
2121```
2222
2323Then you can use it like
@@ -41,32 +41,53 @@ And just sniff a particular file with
4141$ phpcs /path/to/some/file/to/sniff.php
4242```
4343
44- ### 2. Custom installation
44+ ### 2. Global installation
45+
46+ You also can install the Doctrine Coding Standard globally:
47+
48+ ``` bash
49+ $ php composer global require doctrine/coding-standard:~ 0.1@dev
50+ ```
51+
52+ Then you can use it like:
53+
54+ ``` bash
55+ $ phpcs --standard=~ /.composer/vendor/doctrine/coding-standard/Doctrine /path/to/some/file/to/sniff.php
56+ ```
57+
58+ Or even set it as default standard:
59+
60+ ``` bash
61+ $ phpcs --config-set default_standard ~ /.composer/vendor/doctrine/coding-standard/Doctrine
62+ ```
63+
64+ And just sniff a particular file with:
65+
66+ ``` bash
67+ $ phpcs /path/to/some/file/to/sniff.php
68+ ```
69+
70+ ### 3. Custom installation
4571
4672You can install the Doctrine Coding Standard anywhere you want:
4773
4874``` bash
49- $ cd /path/to/whatever/directory/you/want
50- $ git clone https://github.com/doctrine/coding-standard.git Doctrine
75+ $ php composer create-project doctrine/coding-standard /path/to/coding-standard/Doctrine ~ 0.1@dev
5176```
5277
53- Then you can use it like (assuming that you have the ` phpcs ` binary in your search path) :
78+ Then you can use it like:
5479
5580``` bash
56- $ phpcs --standard=/path/to/whatever/directory/you/want/Doctrine /path/to/some/file/to/sniff.php
81+ $ ./vendor/bin/ phpcs --standard=. /path/to/some/file/to/sniff.php
5782```
5883
59- ### 3 . As a composer dependency of your project
84+ ### 4 . As a composer dependency of your project
6085
6186You can install the Doctrine Coding Standard as a composer dependency to your particular project.
6287Just add the following block to your project's ` composer.json ` file:
6388
64- ``` js
65- {
66- " require" : {
67- " doctrine/coding-standard" : " dev-master"
68- }
69- }
89+ ``` bash
90+ $ php composer require doctrine/coding-standard:~ 0.1@dev
7091```
7192
7293Then you can use it like:
@@ -82,7 +103,7 @@ If you are contributing to the Doctrine Coding Standard and want to test your co
82103make sure all dependencies are correctly installed:
83104
84105``` bash
85- $ php composer.phar install --prefer-source --dev
106+ $ php composer install --prefer-source
86107```
87108
88109The option ` --prefer-source ` is particularly necessary to ensure the test suite from PHP_CodeSniffer is
0 commit comments