From a96f5e1ac1d34e8c0ee8712d002dafec12104897 Mon Sep 17 00:00:00 2001 From: Martin Guth Date: Thu, 18 Apr 2024 13:02:41 +0200 Subject: [PATCH] fixup! Upgrade everything to its newest version, use PSR-12 --- composer.json | 2 +- ecs.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 20493d0..4e8724a 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "phpstan/extension-installer": "^1.1", "phpstan/phpstan": "^1.3.0", "phpstan/phpstan-phpunit": "^1.0.0", - "phpunit/phpunit": "^9.5.2" + "phpunit/phpunit": "^9.6.19" }, "prefer-stable": true, "autoload": { diff --git a/ecs.php b/ecs.php index c92cbb9..9c8fb3c 100644 --- a/ecs.php +++ b/ecs.php @@ -43,6 +43,7 @@ use PhpCsFixer\Fixer\ArrayNotation\NormalizeIndexBraceFixer; use PhpCsFixer\Fixer\ArrayNotation\TrimArraySpacesFixer; use PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer; +use PhpCsFixer\Fixer\Basic\BracesFixer; use PhpCsFixer\Fixer\Basic\NoTrailingCommaInSinglelineFixer; use PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer; use PhpCsFixer\Fixer\Casing\MagicMethodCasingFixer; @@ -458,6 +459,9 @@ ->withConfiguredRule(OperatorSpacingSniff::class, ['ignoreNewlines' => true]) // PHP arrays should be declared using the configured syntax ->withConfiguredRule(ArraySyntaxFixer::class, ['syntax' => 'short']) + // The body of each structure MUST be enclosed by braces. Braces should be properly placed + // @TODO move configuration to BracesPositionFixer after BracesFixer is not included in PSR-12 check anymore + ->withConfiguredRule(BracesFixer::class, ['allow_single_line_closure' => true, 'allow_single_line_anonymous_class_with_empty_body' => true]) // Class, trait and interface elements must be separated with one or none blank line ->withConfiguredRule(ClassAttributesSeparationFixer::class, ['elements' => ['method' => 'one']]) // Visibility MUST be declared on all properties, methods and class constants