|
1 | | -# PHPCSDevTools |
2 | | -Tools for PHP_CodeSniffer sniff developers |
| 1 | +PHPCSDevTools for developers of PHP_CodeSniffer sniffs |
| 2 | +===================================================== |
| 3 | + |
| 4 | +[](https://packagist.org/packages/phpcsstandards/phpcsdevtools) |
| 5 | +[](https://travis-ci.com/PHPCSStandards/PHPCSDevTools/branches) |
| 6 | +[](https://github.com/PHPCSStandards/PHPCSDevTools/releases) |
| 7 | +:construction: |
| 8 | +[](https://packagist.org/packages/phpcsstandards/phpcsdevtools#dev-develop) |
| 9 | +[](https://travis-ci.com/PHPCSStandards/PHPCSDevTools/branches) |
| 10 | +[](https://github.com/PHPCSStandards/PHPCSDevTools/commits/develop) |
| 11 | + |
| 12 | +[](https://packagist.org/packages/phpcsstandards/phpcsdevtools) |
| 13 | +[](https://travis-ci.com/PHPCSStandards/PHPCSDevTools) |
| 14 | + |
| 15 | +[](https://github.com/PHPCSStandards/PHPCSDevTools/blob/master/LICENSE) |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | +This is a set of tools to aid developers of sniffs for [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer). |
| 20 | + |
| 21 | +* [Installation](#installation) |
| 22 | + + [Composer Project-based Installation](#composer-project-based-installation) |
| 23 | + + [Composer Global Installation](#composer-global-installation) |
| 24 | + + [Stand-alone Installation](#stand-alone-installation) |
| 25 | +* [Contributing](#contributing) |
| 26 | +* [License](#license) |
| 27 | + |
| 28 | + |
| 29 | +Installation |
| 30 | +------------------------------------------- |
| 31 | + |
| 32 | +### Composer Project-based Installation |
| 33 | + |
| 34 | +Run the following from the root of your project: |
| 35 | +```bash |
| 36 | +composer require phpcsstandards/phpcsdevtools:^1.0 |
| 37 | +``` |
| 38 | + |
| 39 | +### Composer Global Installation |
| 40 | + |
| 41 | +If you work on several different sniff repos, you may want to install this toolset globally: |
| 42 | +```bash |
| 43 | +composer global require phpcsstandards/phpcsdevtools:^1.0 |
| 44 | +``` |
| 45 | + |
| 46 | +### Stand-alone Installation |
| 47 | + |
| 48 | +* Install [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) via [your preferred method](https://github.com/squizlabs/PHP_CodeSniffer#installation). |
| 49 | +* Register the path to PHPCS in your system `$PATH` environment variable to make the `phpcs` command available from anywhere in your file system. |
| 50 | +* Download the [latest PHPCSDevTools release](https://github.com/PHPCSStandards/PHPCSDevTools/releases) and unzip/untar it into an arbitrary directory. |
| 51 | + You can also choose to clone this repository using git. |
| 52 | +* Add the path to the directory in which you placed your copy of the PHPCSDevTools repo to the PHP CodeSniffer configuration using the below command: |
| 53 | + ```bash |
| 54 | + phpcs --config-set installed_paths /path/to/PHPCSDevTools |
| 55 | + ``` |
| 56 | + **Warning**: :warning: The `installed_paths` command overwrites any previously set `installed_paths`. If you have previously set `installed_paths` for other external standards, run `phpcs --config-show` first and then run the `installed_paths` command with all the paths you need separated by comma's, i.e.: |
| 57 | + ```bash |
| 58 | + phpcs --config-set installed_paths /path/1,/path/2,/path/3 |
| 59 | + ``` |
| 60 | + |
| 61 | + |
| 62 | +Contributing |
| 63 | +------- |
| 64 | +Contributions to this project are welcome. Just clone the repo, branch off from `develop`, make your changes, commit them and send in a pull request. |
| 65 | + |
| 66 | +If unsure whether the changes you are proposing would be welcome, open an issue first to discuss your proposal. |
| 67 | + |
| 68 | +License |
| 69 | +------- |
| 70 | +This code is released under the GNU Lesser General Public License (LGPLv3). For more information, visit http://www.gnu.org/copyleft/lesser.html |
0 commit comments