File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,3 +23,6 @@ clover.xml
2323
2424# Ignore PHPUnit cache file
2525.phpunit.result.cache
26+
27+ # Ignore PHP-CS-Fixer cache file
28+ .php-cs-fixer.cache
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ $ finder = PhpCsFixer \Finder::create ()
4+ ->in (__DIR__ )
5+ ->exclude ('vendor ' )
6+ ->path ('lib ' )
7+ ->path ('init.php ' )
8+ ->path ('build.php ' );
9+
10+ $ config = new PhpCsFixer \Config ();
11+ return $ config ->setRules ([
12+ '@PSR12 ' => true ,
13+ 'strict_param ' => true ,
14+ 'array_syntax ' => ['syntax ' => 'short ' ],
15+ 'no_unused_imports ' => true ,
16+ ])
17+ ->setFinder ($ finder );
Original file line number Diff line number Diff line change 2222 },
2323 "require-dev" : {
2424 "phpunit/phpunit" : " ~5.7 || ~9.5" ,
25- "squizlabs/php_codesniffer" : " ~3.6"
25+ "squizlabs/php_codesniffer" : " ~3.6" ,
26+ "friendsofphp/php-cs-fixer" : " ^3.75"
2627 },
2728 "autoload" : {
2829 "psr-4" : { "Payjp\\ " : " lib/" }
3637 "test" : [
3738 " phpcs --standard=PSR2 -n lib tests *.php" ,
3839 " phpunit"
40+ ],
41+ "fix" : [
42+ " PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes"
3943 ]
4044 }
4145}
You can’t perform that action at this time.
0 commit comments