Skip to content

Commit 5f1c982

Browse files
committed
Switch to PER-CS ruleset for coding standard checking.
1 parent a6df23f commit 5f1c982

File tree

5 files changed

+15
-31
lines changed

5 files changed

+15
-31
lines changed

.php-cs-fixer.php

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,17 @@
99
$config = new PhpCsFixer\Config();
1010
return $config
1111
->setRules([
12-
'@Symfony' => true,
13-
'@PSR12' => true,
14-
'binary_operator_spaces' => ['default' => null, 'operators' => ['=>' => 'align']],
15-
'concat_space' => ['spacing' => 'one'],
16-
'declare_strict_types' => true,
17-
'no_alias_functions' => true,
18-
'no_useless_sprintf' => true,
19-
'ordered_imports' => [
20-
'imports_order' => [
21-
'class',
22-
'function',
23-
'const',
24-
],
25-
'sort_algorithm' => 'alpha'
26-
],
27-
'phpdoc_align' => ['align' => 'left'],
28-
'phpdoc_summary' => false,
29-
'self_accessor' => true,
30-
'single_line_throw' => false,
31-
'visibility_required' => ['elements' => ['property', 'method']], // removed 'const' since we still support PHP 7.0 for now
32-
'yoda_style' => false,
12+
'@PER-CS' => true,
13+
'binary_operator_spaces' => ['default' => 'at_least_single_space', 'operators' => ['=>' => 'align']],
14+
'declare_strict_types' => true,
15+
'no_alias_functions' => true,
16+
'no_useless_sprintf' => true,
17+
'nullable_type_declaration_for_default_null_value' => false, // should be 'true' when we drop support for PHP 7.0 which didn't support nullable types yet
18+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
19+
'phpdoc_align' => ['align' => 'vertical'],
20+
'phpdoc_separation' => ['skip_unlisted_annotations' => true],
21+
'self_accessor' => true,
22+
'visibility_required' => ['elements' => ['property', 'method']], // removed 'const' since we still support PHP 7.0 for now
3323
])
3424
->setFinder($finder)
3525
;

Exception/AlreadyRefreshingException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use Magento\Framework\Exception\LocalizedException;
88

9-
class AlreadyRefreshingException extends LocalizedException
10-
{
11-
}
9+
class AlreadyRefreshingException extends LocalizedException {}

Exception/MissingConfigurationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use Magento\Framework\Exception\LocalizedException;
88

9-
class MissingConfigurationException extends LocalizedException
10-
{
11-
}
9+
class MissingConfigurationException extends LocalizedException {}

Exception/SerializationException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@
66

77
use Magento\Framework\Exception\LocalizedException;
88

9-
class SerializationException extends LocalizedException
10-
{
11-
}
9+
class SerializationException extends LocalizedException {}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ check: checkstyle checkquality test
1111
.PHONY: checkstyle
1212
checkstyle:
1313
vendor-bin/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes
14-
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction,Magento2.Commenting.ClassPropertyPHPDocFormatting,Magento2.Annotation.MethodAnnotationStructure,Magento2.Annotation.MethodArguments,PSR12.Properties.ConstantVisibility --ignore=./vendor/,./vendor-bin/ .
14+
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=Magento2 --exclude=Magento2.Security.InsecureFunction,Magento2.Commenting.ClassPropertyPHPDocFormatting,Magento2.Annotation.MethodAnnotationStructure,Magento2.Annotation.MethodArguments,PSR12.Properties.ConstantVisibility,PSR2.Classes.ClassDeclaration,Squiz.WhiteSpace.ScopeClosingBrace --ignore=./vendor/,./vendor-bin/ .
1515
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.0- --ignore=./vendor/,./vendor-bin/,./Test/ .
1616
vendor-bin/phpcs/vendor/bin/phpcs -s --standard=PHPCompatibility --runtime-set testVersion 7.1- ./Test/
1717
vendor/bin/composer normalize --dry-run

0 commit comments

Comments
 (0)