-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding php 8.0 and 8.1 fixer classes,, upgraded php-cs-fixer (#2)
* adding php 8.0 and 8.1 fixer classes,, upgraded php-cs-fixer * allowing 2.x version of ergebnis library for code that still needs php-cs-fixer 2.x
- Loading branch information
Showing
7 changed files
with
171 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/vendor | ||
composer.lock | ||
.php_cs.cache | ||
.php_cs.cache | ||
.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
namespace DiabloMedia\PhpCsFixer\Config\RuleSet; | ||
|
||
use Ergebnis\PhpCsFixer\Config\RuleSet\AbstractRuleSet; | ||
|
||
final class Php80 extends AbstractRuleSet | ||
{ | ||
protected $name = 'diablomedia (PHP 8.0)'; | ||
|
||
protected $rules = [ | ||
// Pre-defined rule sets | ||
'@PSR2' => true, | ||
'@PSR12' => true, | ||
'@PSR12:risky' => true, | ||
'@PHP70Migration' => true, | ||
'@PHP71Migration' => true, | ||
'@PHP71Migration:risky' => true, | ||
'@PHP73Migration' => true, | ||
'@PHP74Migration' => true, | ||
'@PHP74Migration:risky' => true, | ||
'@PHP80Migration' => true, | ||
'@PHP80Migration:risky' => true, | ||
'@PHPUnit60Migration:risky' => true, | ||
'@PHPUnit75Migration:risky' => true, | ||
'@PHPUnit84Migration:risky' => true, | ||
// Individual rules | ||
'array_syntax' => ['syntax' => 'short'], | ||
'binary_operator_spaces' => [ | ||
'default' => 'align_single_space_minimal', | ||
'operators' => ['||' => null, '&&' => null, '==' => null, '===' => null, '+' => null], | ||
], | ||
'class_attributes_separation' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'declare_strict_types' => false, | ||
'dir_constant' => true, | ||
'lowercase_static_reference' => true, | ||
'no_empty_comment' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_leading_import_slash' => true, | ||
'no_mixed_echo_print' => ['use' => 'echo'], | ||
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], | ||
'no_unneeded_control_parentheses' => true, | ||
'no_unneeded_curly_braces' => true, | ||
'no_unused_imports' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => [ | ||
'order' => [ | ||
'use_trait', | ||
'constant_public', | ||
'constant_protected', | ||
'constant_private', | ||
'property_public', | ||
'property_protected', | ||
'property_private', | ||
'construct', | ||
'destruct', | ||
'magic', | ||
'phpunit', | ||
'method_public', | ||
'method_protected', | ||
'method_private', | ||
], | ||
'sort_algorithm' => 'alpha', | ||
], | ||
'ordered_imports' => [ | ||
'imports_order' => [ | ||
'const', | ||
'class', | ||
'function', | ||
], | ||
'sort_algorithm' => 'alpha', | ||
], | ||
'php_unit_construct' => true, | ||
'return_type_declaration' => ['space_before' => 'none'], | ||
'single_quote' => false, | ||
'ternary_to_null_coalescing' => true, | ||
]; | ||
|
||
protected $targetPhpVersion = 80000; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
|
||
namespace DiabloMedia\PhpCsFixer\Config\RuleSet; | ||
|
||
use Ergebnis\PhpCsFixer\Config\RuleSet\AbstractRuleSet; | ||
|
||
final class Php81 extends AbstractRuleSet | ||
{ | ||
protected $name = 'diablomedia (PHP 8.1)'; | ||
|
||
protected $rules = [ | ||
// Pre-defined rule sets | ||
'@PSR2' => true, | ||
'@PSR12' => true, | ||
'@PSR12:risky' => true, | ||
'@PHP70Migration' => true, | ||
'@PHP71Migration' => true, | ||
'@PHP71Migration:risky' => true, | ||
'@PHP73Migration' => true, | ||
'@PHP74Migration' => true, | ||
'@PHP74Migration:risky' => true, | ||
'@PHP80Migration' => true, | ||
'@PHP80Migration:risky' => true, | ||
'@PHP81Migration' => true, | ||
'@PHPUnit60Migration:risky' => true, | ||
'@PHPUnit75Migration:risky' => true, | ||
'@PHPUnit84Migration:risky' => true, | ||
// Individual rules | ||
'array_syntax' => ['syntax' => 'short'], | ||
'binary_operator_spaces' => [ | ||
'default' => 'align_single_space_minimal', | ||
'operators' => ['||' => null, '&&' => null, '==' => null, '===' => null, '+' => null], | ||
], | ||
'class_attributes_separation' => true, | ||
'concat_space' => ['spacing' => 'one'], | ||
'declare_strict_types' => false, | ||
'dir_constant' => true, | ||
'lowercase_static_reference' => true, | ||
'no_empty_comment' => true, | ||
'no_empty_phpdoc' => true, | ||
'no_leading_import_slash' => true, | ||
'no_mixed_echo_print' => ['use' => 'echo'], | ||
'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], | ||
'no_unneeded_control_parentheses' => true, | ||
'no_unneeded_curly_braces' => true, | ||
'no_unused_imports' => true, | ||
'no_useless_return' => true, | ||
'ordered_class_elements' => [ | ||
'order' => [ | ||
'use_trait', | ||
'constant_public', | ||
'constant_protected', | ||
'constant_private', | ||
'property_public', | ||
'property_protected', | ||
'property_private', | ||
'construct', | ||
'destruct', | ||
'magic', | ||
'phpunit', | ||
'method_public', | ||
'method_protected', | ||
'method_private', | ||
], | ||
'sort_algorithm' => 'alpha', | ||
], | ||
'ordered_imports' => [ | ||
'imports_order' => [ | ||
'const', | ||
'class', | ||
'function', | ||
], | ||
'sort_algorithm' => 'alpha', | ||
], | ||
'php_unit_construct' => true, | ||
'return_type_declaration' => ['space_before' => 'none'], | ||
'single_quote' => false, | ||
'ternary_to_null_coalescing' => true, | ||
]; | ||
|
||
protected $targetPhpVersion = 80100; | ||
} |