File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed
Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 3535 wget https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer.phar
3636 chmod +x php-cs-fixer.phar
3737
38- # Run PHP-CS-Fixer (check coding standards)
38+ # Run PHP-CS-Fixer (fix coding standards)
3939 - name : Run PHP-CS-Fixer
40- run : ./php-cs-fixer.phar fix --dry-run --diff --verbose . || [ $? -eq 8 ]
40+ run : ./php-cs-fixer.phar fix --verbose .
41+
42+ # Download PHP_CodeSniffer
43+ - name : Download PHP_CodeSniffer
44+ run : |
45+ wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar -O phpcs.phar
46+ chmod +x phpcs.phar
47+
48+ # Run PHP_CodeSniffer (check coding standards)
49+ - name : Run PHP_CodeSniffer
50+ run : ./phpcs.phar --standard=PSR12 .
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ return (new PhpCsFixer \Config ())
4+ ->setRules ([
5+ '@PSR12 ' => true , // Use PSR-12 coding standard
6+ 'array_syntax ' => ['syntax ' => 'short ' ], // Use short array syntax
7+ 'no_unused_imports ' => true , // Remove unused imports
8+ 'binary_operator_spaces ' => [ // Fix spacing around operators
9+ 'operators ' => [
10+ '. ' => 'single_space ' , // Fix spacing around concatenation (.)
11+ '=> ' => 'single_space ' , // Fix spacing around array arrows (=>)
12+ ],
13+ ],
14+ 'no_whitespace_in_blank_line ' => true , // Remove trailing whitespace
15+ 'no_trailing_whitespace ' => true , // Remove trailing whitespace
16+ 'braces ' => [ // Fix braces placement
17+ 'allow_single_line_closure ' => true ,
18+ ],
19+ ])
20+ ->setFinder (
21+ PhpCsFixer \Finder::create ()
22+ ->in (__DIR__ ) // Apply to the current directory
23+ ->exclude ('vendor ' ) // Exclude the vendor directory
24+ );
You can’t perform that action at this time.
0 commit comments