cakephp/cakephp-codesniffer
Fork: 84 Star: 238 (更新于 2024-12-01 08:00:15)
license: MIT
Language: PHP .
CakePHP Code Sniffer
最后发布版本: 5.1.3 ( 2024-08-13 20:47:58)
CakePHP Code Sniffer
This code works with squizlabs/php_codesniffer and checks code against the coding standards used in CakePHP.
This sniffer package follows PSR-12 completely and ships with a lot of additional fixers on top.
Which version should I use?
See version map.
Installation
You should install this codesniffer with composer:
composer require --dev cakephp/cakephp-codesniffer
vendor/bin/phpcs --config-set installed_paths /path/to/your/app/vendor/cakephp/cakephp-codesniffer
The second command lets phpcs
know where to find your new sniffs. Ensure that
you do not overwrite any existing installed_paths
value. Alternatively, install
the dealerdirect/phpcodesniffer-composer-installer
composer package which will handle configuring the phpcs
installed_paths
for you.
Usage
:warning: Warning when these sniffs are installed with composer, ensure that
you have configured the CodeSniffer installed_paths
setting.
Depending on how you installed the code sniffer changes how you run it. If you have installed phpcs, and this package with PEAR, you can do the following:
vendor/bin/phpcs --colors -p -s --standard=CakePHP /path/to/code/
You can also copy the phpcs.xml.dist
file to your project's root folder as phpcs.xml
.
This file will import the CakePHP Coding Standard. From there you can edit it to
include/exclude as needed. With this file in place, you can run:
vendor/bin/phpcs --colors -p -s /path/to/code/
If you are using Composer to manage your CakePHP project, you can also add the below to your composer.json file:
{
"scripts": {
"cs-check": "vendor/bin/phpcs --colors -p -s --extensions=php src/ tests/"
}
}
Running Tests
You can run tests with composer. Because of how PHPCS test suites work, there is
additional configuration state in phpcs
that is required.
composer test
Once this has been done once, you can use composer phpunit
to run the
tests for the rules in this repository.
Contributing
If you'd like to contribute to the Code Sniffer, you can fork the project add features and send pull requests.
Releasing CakePHP Code Sniffer
- Create a signed tag
- Write the changelog in the tag commit
最近版本更新:(数据更新于 2024-10-18 20:49:36)
2024-08-13 20:47:58 5.1.3
2024-08-06 08:21:54 5.1.2
2023-09-10 16:30:45 5.1.1
2023-04-10 14:36:17 4.7.0
2023-03-06 04:53:14 5.1.0
2022-11-09 13:04:26 5.0.1
2022-10-20 11:30:51 5.0.0
2022-07-04 11:33:39 4.6.0
2021-07-27 08:06:29 4.5.1
2021-06-16 15:34:37 4.5.0
cakephp/cakephp-codesniffer同语言 PHP最近更新仓库
2024-12-13 19:38:03 coollabsio/coolify
2024-12-13 09:22:46 w7corp/easywechat
2024-12-11 20:15:22 symfony/symfony
2024-11-29 16:49:37 symfony/var-dumper
2024-11-20 23:58:25 laravel/framework
2024-11-20 18:39:23 danielmiessler/SecLists