diff --git a/ecs.php b/ecs.php index b7b4732..29d907f 100644 --- a/ecs.php +++ b/ecs.php @@ -46,6 +46,7 @@ use PhpCsFixer\Fixer\AttributeNotation\AttributeEmptyParenthesesFixer; use PhpCsFixer\Fixer\Basic\BracesFixer; use PhpCsFixer\Fixer\Basic\NoTrailingCommaInSinglelineFixer; +use PhpCsFixer\Fixer\Basic\OctalNotationFixer; use PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer; use PhpCsFixer\Fixer\Basic\SingleLineEmptyBodyFixer; use PhpCsFixer\Fixer\Casing\ClassReferenceNameCasingFixer; @@ -244,6 +245,8 @@ SingleLineEmptyBodyFixer::class, // Defined in PER 2.0 // Values separated by a comma on a single line should not have a trailing comma. NoTrailingCommaInSinglelineFixer::class, + // Literal octal must be in 0o notation. + OctalNotationFixer::class, // Arrays should be formatted like function/method arguments TrimArraySpacesFixer::class, // In array declaration, there MUST be a whitespace after each comma diff --git a/tests/Integration/Fixtures/NewPhpFeatures.correct.php.inc b/tests/Integration/Fixtures/NewPhpFeatures.correct.php.inc index bff038b..e823f58 100644 --- a/tests/Integration/Fixtures/NewPhpFeatures.correct.php.inc +++ b/tests/Integration/Fixtures/NewPhpFeatures.correct.php.inc @@ -43,4 +43,10 @@ class NewPhpFeatures string $foo, string $bar, ): void {} + + public function php81features(): void + { + // OctalNotationFixer + $numberInOctalNotation = 0o0123; + } } diff --git a/tests/Integration/Fixtures/NewPhpFeatures.wrong.php.inc b/tests/Integration/Fixtures/NewPhpFeatures.wrong.php.inc index 5629c7a..a73ba14 100644 --- a/tests/Integration/Fixtures/NewPhpFeatures.wrong.php.inc +++ b/tests/Integration/Fixtures/NewPhpFeatures.wrong.php.inc @@ -44,4 +44,10 @@ class NewPhpFeatures #[ParamAttribute] #[AnotherAttribute('foo')] string $foo, string $bar, ): void {} + + public function php81features(): void + { + // OctalNotationFixer + $numberInOctalNotation = 0123; + } }