diff --git a/blink/testdata/dirty.php b/blink/testdata/dirty.php index 4c1a5f5aaa..8fc74e626e 100644 --- a/blink/testdata/dirty.php +++ b/blink/testdata/dirty.php @@ -1,12 +1,12 @@ withSkip([ '*/Tests/*', '*/tests/*', - '*/Fixtures/DirectoryExpansion/.hiddenAbove/*' + '*/Fixtures/DirectoryExpansion/.hiddenAbove/*', ]); diff --git a/build/target-repository/tests-released/config/some_ecs.php b/build/target-repository/tests-released/config/some_ecs.php index a7ffff8b0e..ff7a6a2a54 100644 --- a/build/target-repository/tests-released/config/some_ecs.php +++ b/build/target-repository/tests-released/config/some_ecs.php @@ -7,5 +7,5 @@ return (ECSConfig::configure()) ->withSets([ // PHP 7.2+ compatible config, to enable PHP 7.2 tests - \Symplify\EasyCodingStandard\ValueObject\Set\SetList::PSR_12 + \Symplify\EasyCodingStandard\ValueObject\Set\SetList::PSR_12, ]); diff --git a/packages/coding-standard/src/Exception/ShouldNotHappenException.php b/packages/coding-standard/src/Exception/ShouldNotHappenException.php index 118c9cbd82..975a79d662 100644 --- a/packages/coding-standard/src/Exception/ShouldNotHappenException.php +++ b/packages/coding-standard/src/Exception/ShouldNotHappenException.php @@ -6,6 +6,4 @@ use Exception; -final class ShouldNotHappenException extends Exception -{ -} +final class ShouldNotHappenException extends Exception {} diff --git a/packages/coding-standard/src/Fixer/Annotation/RemoveEventSubscriberDescriptionFixer.php b/packages/coding-standard/src/Fixer/Annotation/RemoveEventSubscriberDescriptionFixer.php index f45a7eb5d8..f107410e6b 100644 --- a/packages/coding-standard/src/Fixer/Annotation/RemoveEventSubscriberDescriptionFixer.php +++ b/packages/coding-standard/src/Fixer/Annotation/RemoveEventSubscriberDescriptionFixer.php @@ -139,7 +139,7 @@ private function isEventDescriptionLine(string $docblockLine, string $methodName $descriptionWords = array_filter( $descriptionWords, - static fn (string $word): bool => $word !== 'event' + static fn(string $word): bool => $word !== 'event' ); if ($descriptionWords === []) { @@ -149,7 +149,7 @@ private function isEventDescriptionLine(string $docblockLine, string $methodName $methodWords = array_filter( $this->resolveWords($methodName), // event subscriber handlers are commonly prefixed with "on" - static fn (string $word): bool => $word !== 'on' + static fn(string $word): bool => $word !== 'on' ); sort($descriptionWords); diff --git a/packages/coding-standard/src/Fixer/Annotation/RemovePHPStormAnnotationFixer.php b/packages/coding-standard/src/Fixer/Annotation/RemovePHPStormAnnotationFixer.php index 905415da6a..88ff566f7f 100644 --- a/packages/coding-standard/src/Fixer/Annotation/RemovePHPStormAnnotationFixer.php +++ b/packages/coding-standard/src/Fixer/Annotation/RemovePHPStormAnnotationFixer.php @@ -27,8 +27,7 @@ final class RemovePHPStormAnnotationFixer extends AbstractSymplifyFixer public function __construct( private readonly TokenReverser $tokenReverser - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/ArrayNotation/ArrayListItemNewlineFixer.php b/packages/coding-standard/src/Fixer/ArrayNotation/ArrayListItemNewlineFixer.php index 29cbb5dd0c..55c9fc5d9f 100644 --- a/packages/coding-standard/src/Fixer/ArrayNotation/ArrayListItemNewlineFixer.php +++ b/packages/coding-standard/src/Fixer/ArrayNotation/ArrayListItemNewlineFixer.php @@ -27,8 +27,7 @@ public function __construct( private readonly ArrayItemNewliner $arrayItemNewliner, private readonly ArrayAnalyzer $arrayAnalyzer, private readonly ArrayBlockInfoFinder $arrayBlockInfoFinder, - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer.php b/packages/coding-standard/src/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer.php index 121c7770cf..e716d08a76 100644 --- a/packages/coding-standard/src/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer.php +++ b/packages/coding-standard/src/Fixer/ArrayNotation/ArrayOpenerAndCloserNewlineFixer.php @@ -29,8 +29,7 @@ public function __construct( private readonly ArrayBlockInfoFinder $arrayBlockInfoFinder, private readonly WhitespacesFixerConfig $whitespacesFixerConfig, private readonly ArrayAnalyzer $arrayAnalyzer - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/ArrayNotation/StandaloneLineInMultilineArrayFixer.php b/packages/coding-standard/src/Fixer/ArrayNotation/StandaloneLineInMultilineArrayFixer.php index 63b1c11d0e..2eb5a8e4a4 100644 --- a/packages/coding-standard/src/Fixer/ArrayNotation/StandaloneLineInMultilineArrayFixer.php +++ b/packages/coding-standard/src/Fixer/ArrayNotation/StandaloneLineInMultilineArrayFixer.php @@ -29,8 +29,7 @@ public function __construct( private readonly ArrayWrapperFactory $arrayWrapperFactory, private readonly TokensNewliner $tokensNewliner, private readonly BlockFinder $blockFinder - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/Commenting/AbstractDocBlockFixer.php b/packages/coding-standard/src/Fixer/Commenting/AbstractDocBlockFixer.php index 42159c2a7a..41c05bfa70 100644 --- a/packages/coding-standard/src/Fixer/Commenting/AbstractDocBlockFixer.php +++ b/packages/coding-standard/src/Fixer/Commenting/AbstractDocBlockFixer.php @@ -25,8 +25,7 @@ abstract class AbstractDocBlockFixer extends AbstractSymplifyFixer public function __construct( protected readonly TokenReverser $tokenReverser - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/Fixer/Commenting/AddMissingVarNameFixer.php b/packages/coding-standard/src/Fixer/Commenting/AddMissingVarNameFixer.php index 9e6ccd2548..240b50e3d3 100644 --- a/packages/coding-standard/src/Fixer/Commenting/AddMissingVarNameFixer.php +++ b/packages/coding-standard/src/Fixer/Commenting/AddMissingVarNameFixer.php @@ -44,7 +44,7 @@ protected function processDocContent(string $docContent, Tokens $tokens, int $po return Regex::replace( $docContent, self::VAR_WITHOUT_NAME_REGEX, - static fn (array $match): string => $match['open'] . $match['type'] . ' ' . $nextVariableToken->getContent() . $match['close'] + static fn(array $match): string => $match['open'] . $match['type'] . ' ' . $nextVariableToken->getContent() . $match['close'] ); } diff --git a/packages/coding-standard/src/Fixer/Commenting/ParamReturnAndVarTagMalformsFixer.php b/packages/coding-standard/src/Fixer/Commenting/ParamReturnAndVarTagMalformsFixer.php index 3485e5bf74..603a090a55 100644 --- a/packages/coding-standard/src/Fixer/Commenting/ParamReturnAndVarTagMalformsFixer.php +++ b/packages/coding-standard/src/Fixer/Commenting/ParamReturnAndVarTagMalformsFixer.php @@ -36,9 +36,7 @@ public function isCandidate(Tokens $tokens): bool /** * @param Tokens $tokens */ - public function fix(SplFileInfo $fileInfo, Tokens $tokens): void - { - } + public function fix(SplFileInfo $fileInfo, Tokens $tokens): void {} /** * @return list diff --git a/packages/coding-standard/src/Fixer/Commenting/RemoveParamNameReferenceFixer.php b/packages/coding-standard/src/Fixer/Commenting/RemoveParamNameReferenceFixer.php index b911f89acc..b96e8049ee 100644 --- a/packages/coding-standard/src/Fixer/Commenting/RemoveParamNameReferenceFixer.php +++ b/packages/coding-standard/src/Fixer/Commenting/RemoveParamNameReferenceFixer.php @@ -35,7 +35,7 @@ protected function processDocContent(string $docContent, Tokens $tokens, int $po return Regex::replace( $docContent, self::PARAM_NAME_REGEX, - static fn ($match): string => $match['param'] . $match['paramName'] + static fn($match): string => $match['param'] . $match['paramName'] ); } } diff --git a/packages/coding-standard/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php b/packages/coding-standard/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php index 730834775e..e56d9aa99f 100644 --- a/packages/coding-standard/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php +++ b/packages/coding-standard/src/Fixer/Commenting/RemoveUselessDefaultCommentFixer.php @@ -26,8 +26,7 @@ public function __construct( private readonly UselessDocBlockCleaner $uselessDocBlockCleaner, private readonly TokenReverser $tokenReverser, private readonly ClassNameResolver $classNameResolver, - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/Commenting/TypeToVarTagFixer.php b/packages/coding-standard/src/Fixer/Commenting/TypeToVarTagFixer.php index 5b6cf3ddbe..32c4903cc9 100644 --- a/packages/coding-standard/src/Fixer/Commenting/TypeToVarTagFixer.php +++ b/packages/coding-standard/src/Fixer/Commenting/TypeToVarTagFixer.php @@ -34,8 +34,7 @@ final class TypeToVarTagFixer extends AbstractSymplifyFixer public function __construct( private readonly TokenReverser $tokenReverser - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/LineLength/LineLengthFixer.php b/packages/coding-standard/src/Fixer/LineLength/LineLengthFixer.php index 699d662308..2f45b9dd02 100644 --- a/packages/coding-standard/src/Fixer/LineLength/LineLengthFixer.php +++ b/packages/coding-standard/src/Fixer/LineLength/LineLengthFixer.php @@ -73,8 +73,7 @@ public function __construct( private readonly MethodNameResolver $methodNameResolver, private readonly HeredocAnalyzer $heredocAnalyzer, private readonly ?StandaloneLineConstructorParamFixer $standaloneLineConstructorParamFixer = null - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/Spacing/MethodChainingNewlineFixer.php b/packages/coding-standard/src/Fixer/Spacing/MethodChainingNewlineFixer.php index bec0b0323b..7bcead88f0 100644 --- a/packages/coding-standard/src/Fixer/Spacing/MethodChainingNewlineFixer.php +++ b/packages/coding-standard/src/Fixer/Spacing/MethodChainingNewlineFixer.php @@ -28,8 +28,7 @@ public function __construct( private readonly WhitespacesFixerConfig $whitespacesFixerConfig, private readonly BlockFinder $blockFinder, private readonly ChainMethodCallAnalyzer $chainMethodCallAnalyzer - ) { - } + ) {} public function getDefinition(): FixerDefinitionInterface { diff --git a/packages/coding-standard/src/Fixer/Spacing/StandaloneLineConstructorParamFixer.php b/packages/coding-standard/src/Fixer/Spacing/StandaloneLineConstructorParamFixer.php index 8a92d706ef..291d861435 100644 --- a/packages/coding-standard/src/Fixer/Spacing/StandaloneLineConstructorParamFixer.php +++ b/packages/coding-standard/src/Fixer/Spacing/StandaloneLineConstructorParamFixer.php @@ -24,8 +24,7 @@ final class StandaloneLineConstructorParamFixer extends AbstractSymplifyFixer public function __construct( private readonly ParamNewliner $paramNewliner, private readonly MethodNameResolver $methodNameResolver - ) { - } + ) {} /** * Must run before diff --git a/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePlainConstructorParamFixer.php b/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePlainConstructorParamFixer.php index f20f19edd8..f06aff8ad8 100644 --- a/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePlainConstructorParamFixer.php +++ b/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePlainConstructorParamFixer.php @@ -46,8 +46,7 @@ final class StandaloneLinePlainConstructorParamFixer extends AbstractSymplifyFix public function __construct( private readonly ParamNewliner $paramNewliner, private readonly MethodNameResolver $methodNameResolver - ) { - } + ) {} /** * Must run before diff --git a/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePromotedPropertyFixer.php b/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePromotedPropertyFixer.php index f21b1b6cef..f8920aaac2 100644 --- a/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePromotedPropertyFixer.php +++ b/packages/coding-standard/src/Fixer/Spacing/StandaloneLinePromotedPropertyFixer.php @@ -25,8 +25,7 @@ final class StandaloneLinePromotedPropertyFixer extends AbstractSymplifyFixer public function __construct( private readonly ParamNewliner $paramNewliner, private readonly MethodNameResolver $methodNameResolver - ) { - } + ) {} /** * Must run before diff --git a/packages/coding-standard/src/Fixer/Spacing/StandaloneLineRequiredParamFixer.php b/packages/coding-standard/src/Fixer/Spacing/StandaloneLineRequiredParamFixer.php index 9a970adde4..498d2d226a 100644 --- a/packages/coding-standard/src/Fixer/Spacing/StandaloneLineRequiredParamFixer.php +++ b/packages/coding-standard/src/Fixer/Spacing/StandaloneLineRequiredParamFixer.php @@ -46,8 +46,7 @@ final class StandaloneLineRequiredParamFixer extends AbstractSymplifyFixer public function __construct( private readonly ParamNewliner $paramNewliner - ) { - } + ) {} /** * Must run before diff --git a/packages/coding-standard/src/Fixer/Spacing/StandaloneLineSymfonyAttributeParamFixer.php b/packages/coding-standard/src/Fixer/Spacing/StandaloneLineSymfonyAttributeParamFixer.php index d19ac222e9..8287358123 100644 --- a/packages/coding-standard/src/Fixer/Spacing/StandaloneLineSymfonyAttributeParamFixer.php +++ b/packages/coding-standard/src/Fixer/Spacing/StandaloneLineSymfonyAttributeParamFixer.php @@ -60,8 +60,7 @@ final class StandaloneLineSymfonyAttributeParamFixer extends AbstractSymplifyFix public function __construct( private readonly TokensNewliner $tokensNewliner - ) { - } + ) {} /** * Must run before diff --git a/packages/coding-standard/src/TokenAnalyzer/ChainMethodCallAnalyzer.php b/packages/coding-standard/src/TokenAnalyzer/ChainMethodCallAnalyzer.php index 7030256540..618cde7a94 100644 --- a/packages/coding-standard/src/TokenAnalyzer/ChainMethodCallAnalyzer.php +++ b/packages/coding-standard/src/TokenAnalyzer/ChainMethodCallAnalyzer.php @@ -14,8 +14,7 @@ final class ChainMethodCallAnalyzer public function __construct( private readonly NewlineAnalyzer $newlineAnalyzer - ) { - } + ) {} /** * Matches e.g: return app()->some(), app()->some(), (clone app)->some() diff --git a/packages/coding-standard/src/TokenAnalyzer/ParamNewliner.php b/packages/coding-standard/src/TokenAnalyzer/ParamNewliner.php index f0aa6b3a0d..a161f9ae2a 100644 --- a/packages/coding-standard/src/TokenAnalyzer/ParamNewliner.php +++ b/packages/coding-standard/src/TokenAnalyzer/ParamNewliner.php @@ -16,8 +16,7 @@ public function __construct( private BlockFinder $blockFinder, private TokensNewliner $tokensNewliner, - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/ArrayAnalyzer.php b/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/ArrayAnalyzer.php index 818c7d453f..1ffaa84021 100644 --- a/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/ArrayAnalyzer.php +++ b/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/ArrayAnalyzer.php @@ -13,8 +13,7 @@ { public function __construct( private TokenSkipper $tokenSkipper - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/IndentDetector.php b/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/IndentDetector.php index 5d4fd436d3..afe8885fca 100644 --- a/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/IndentDetector.php +++ b/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/IndentDetector.php @@ -12,8 +12,7 @@ { public function __construct( private WhitespacesFixerConfig $whitespacesFixerConfig - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/TokenSkipper.php b/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/TokenSkipper.php index 4dc746cb7c..ae59278aed 100644 --- a/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/TokenSkipper.php +++ b/packages/coding-standard/src/TokenRunner/Analyzer/FixerAnalyzer/TokenSkipper.php @@ -15,8 +15,7 @@ { public function __construct( private BlockFinder $blockFinder - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Arrays/ArrayItemNewliner.php b/packages/coding-standard/src/TokenRunner/Arrays/ArrayItemNewliner.php index 2efaf7bee6..78896cea8e 100644 --- a/packages/coding-standard/src/TokenRunner/Arrays/ArrayItemNewliner.php +++ b/packages/coding-standard/src/TokenRunner/Arrays/ArrayItemNewliner.php @@ -15,8 +15,7 @@ public function __construct( private ArrayAnalyzer $arrayAnalyzer, private WhitespacesFixerConfig $whitespacesFixerConfig - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Exception/MissingImplementationException.php b/packages/coding-standard/src/TokenRunner/Exception/MissingImplementationException.php index b3cbd8d295..6bd2dc2b36 100644 --- a/packages/coding-standard/src/TokenRunner/Exception/MissingImplementationException.php +++ b/packages/coding-standard/src/TokenRunner/Exception/MissingImplementationException.php @@ -6,6 +6,4 @@ use Exception; -final class MissingImplementationException extends Exception -{ -} +final class MissingImplementationException extends Exception {} diff --git a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/FirstLineLengthResolver.php b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/FirstLineLengthResolver.php index e0bc51a8ed..935d7f19e2 100644 --- a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/FirstLineLengthResolver.php +++ b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/FirstLineLengthResolver.php @@ -15,8 +15,7 @@ { public function __construct( private LineLengthAndPositionFactory $lineLengthAndPositionFactory - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthCloserTransformer.php b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthCloserTransformer.php index 4a6ff995b7..971aa0f3e0 100644 --- a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthCloserTransformer.php +++ b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthCloserTransformer.php @@ -17,8 +17,7 @@ public function __construct( private CallAnalyzer $callAnalyzer, private TokenFinder $tokenFinder - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthOpenerTransformer.php b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthOpenerTransformer.php index 01905ef122..2e751906a7 100644 --- a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthOpenerTransformer.php +++ b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthOpenerTransformer.php @@ -14,8 +14,7 @@ { public function __construct( private CallAnalyzer $callAnalyzer - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthTransformer.php b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthTransformer.php index 8cfb81649f..ddb51616f6 100644 --- a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthTransformer.php +++ b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/LineLengthTransformer.php @@ -17,8 +17,7 @@ public function __construct( private TokensInliner $tokensInliner, private FirstLineLengthResolver $firstLineLengthResolver, private TokensNewliner $tokensNewliner - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensInliner.php b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensInliner.php index 9e2fc191a4..a4306f14f2 100644 --- a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensInliner.php +++ b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensInliner.php @@ -13,8 +13,7 @@ { public function __construct( private TokenSkipper $tokenSkipper - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php index b89e9a747b..b518867207 100644 --- a/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php +++ b/packages/coding-standard/src/TokenRunner/Transformer/FixerTransformer/TokensNewliner.php @@ -20,8 +20,7 @@ public function __construct( private LineLengthOpenerTransformer $lineLengthOpenerTransformer, private WhitespacesFixerConfig $whitespacesFixerConfig, private IndentResolver $indentResolver - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Traverser/ArrayBlockInfoFinder.php b/packages/coding-standard/src/TokenRunner/Traverser/ArrayBlockInfoFinder.php index 18069edf7d..288b6acbf2 100644 --- a/packages/coding-standard/src/TokenRunner/Traverser/ArrayBlockInfoFinder.php +++ b/packages/coding-standard/src/TokenRunner/Traverser/ArrayBlockInfoFinder.php @@ -14,8 +14,7 @@ { public function __construct( private BlockFinder $blockFinder - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/ValueObject/BlockInfo.php b/packages/coding-standard/src/TokenRunner/ValueObject/BlockInfo.php index c9a2ac9ea0..45dd6b556d 100644 --- a/packages/coding-standard/src/TokenRunner/ValueObject/BlockInfo.php +++ b/packages/coding-standard/src/TokenRunner/ValueObject/BlockInfo.php @@ -9,8 +9,7 @@ public function __construct( private int $start, private int $end - ) { - } + ) {} public function getStart(): int { diff --git a/packages/coding-standard/src/TokenRunner/ValueObject/LineLengthAndPosition.php b/packages/coding-standard/src/TokenRunner/ValueObject/LineLengthAndPosition.php index 04a1b84eed..65ad3de57f 100644 --- a/packages/coding-standard/src/TokenRunner/ValueObject/LineLengthAndPosition.php +++ b/packages/coding-standard/src/TokenRunner/ValueObject/LineLengthAndPosition.php @@ -9,8 +9,7 @@ public function __construct( private int $lineLength, private int $currentPosition - ) { - } + ) {} public function getLineLength(): int { diff --git a/packages/coding-standard/src/TokenRunner/ValueObject/Wrapper/FixerWrapper/ArrayWrapper.php b/packages/coding-standard/src/TokenRunner/ValueObject/Wrapper/FixerWrapper/ArrayWrapper.php index 5ca048bdc8..a037e9b526 100644 --- a/packages/coding-standard/src/TokenRunner/ValueObject/Wrapper/FixerWrapper/ArrayWrapper.php +++ b/packages/coding-standard/src/TokenRunner/ValueObject/Wrapper/FixerWrapper/ArrayWrapper.php @@ -24,8 +24,7 @@ public function __construct( private Tokens $tokens, private BlockInfo $blockInfo, private TokenSkipper $tokenSkipper - ) { - } + ) {} public function isAssociativeArray(): bool { diff --git a/packages/coding-standard/src/TokenRunner/Whitespace/IndentResolver.php b/packages/coding-standard/src/TokenRunner/Whitespace/IndentResolver.php index ad0bdf4073..8752128207 100644 --- a/packages/coding-standard/src/TokenRunner/Whitespace/IndentResolver.php +++ b/packages/coding-standard/src/TokenRunner/Whitespace/IndentResolver.php @@ -14,8 +14,7 @@ public function __construct( private IndentDetector $indentDetector, private WhitespacesFixerConfig $whitespacesFixerConfig - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/TokenRunner/Wrapper/FixerWrapper/ArrayWrapperFactory.php b/packages/coding-standard/src/TokenRunner/Wrapper/FixerWrapper/ArrayWrapperFactory.php index 3c050cab79..1e281fd015 100644 --- a/packages/coding-standard/src/TokenRunner/Wrapper/FixerWrapper/ArrayWrapperFactory.php +++ b/packages/coding-standard/src/TokenRunner/Wrapper/FixerWrapper/ArrayWrapperFactory.php @@ -14,8 +14,7 @@ { public function __construct( private TokenSkipper $tokenSkipper - ) { - } + ) {} /** * @param Tokens $tokens diff --git a/packages/coding-standard/src/ValueObject/BlockInfoMetadata.php b/packages/coding-standard/src/ValueObject/BlockInfoMetadata.php index 2450e86a7f..d5a07a87af 100644 --- a/packages/coding-standard/src/ValueObject/BlockInfoMetadata.php +++ b/packages/coding-standard/src/ValueObject/BlockInfoMetadata.php @@ -11,8 +11,7 @@ public function __construct( private string $blockType, private BlockInfo $blockInfo - ) { - } + ) {} public function getBlockType(): string { diff --git a/packages/coding-standard/tests/Utils/RegexTest.php b/packages/coding-standard/tests/Utils/RegexTest.php index eb9719471f..61c9ba369a 100644 --- a/packages/coding-standard/tests/Utils/RegexTest.php +++ b/packages/coding-standard/tests/Utils/RegexTest.php @@ -44,7 +44,7 @@ public function testReplaceWithDefaultRemovesMatch(): void public function testReplaceWithCallable(): void { - $result = Regex::replace('a1b', '#\d#', static fn (array $match): string => '[' . $match[0] . ']'); + $result = Regex::replace('a1b', '#\d#', static fn(array $match): string => '[' . $match[0] . ']'); $this->assertSame('a[1]b', $result); } diff --git a/scoper.php b/scoper.php index 37bd793e19..792de42cc1 100644 --- a/scoper.php +++ b/scoper.php @@ -14,7 +14,7 @@ // @see https://github.com/humbug/php-scoper/blob/cb23986d9309a10eaa284242f2169723af4e4a7e/docs/further-reading.md#further-reading $polyfillsBootstraps = array_map( - static fn (SplFileInfo $fileInfo) => $fileInfo->getPathname(), + static fn(SplFileInfo $fileInfo) => $fileInfo->getPathname(), iterator_to_array( Finder::create() ->files() @@ -25,7 +25,7 @@ ); $polyfillsStubs = array_map( - static fn (SplFileInfo $fileInfo) => $fileInfo->getPathname(), + static fn(SplFileInfo $fileInfo) => $fileInfo->getPathname(), iterator_to_array( Finder::create() ->files() @@ -112,9 +112,9 @@ static function (string $filePath, string $prefix, string $content): string { // fixes https://github.com/easy-coding-standard/ecs-src/issues/4 function (string $filePath, string $prefix, string $content): string { if ( - ! str_ends_with($filePath, 'src/Testing/PHPUnit/AbstractCheckerTestCase.php') && - ! str_ends_with($filePath, 'src/Testing/PHPUnit/AbstractTestCase.php') && - ! str_ends_with($filePath, 'src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php') + ! str_ends_with($filePath, 'src/Testing/PHPUnit/AbstractCheckerTestCase.php') + && ! str_ends_with($filePath, 'src/Testing/PHPUnit/AbstractTestCase.php') + && ! str_ends_with($filePath, 'src/Fixer/PhpUnit/PhpUnitTestClassRequiresCoversFixer.php') ) { return $content; } diff --git a/src/Application/EasyCodingStandardApplication.php b/src/Application/EasyCodingStandardApplication.php index 7a7c4cde79..a5be22d162 100644 --- a/src/Application/EasyCodingStandardApplication.php +++ b/src/Application/EasyCodingStandardApplication.php @@ -39,8 +39,7 @@ public function __construct( private ParallelFileProcessor $parallelFileProcessor, private CpuCoreCountProvider $cpuCoreCountProvider, private ParametersMerger $parametersMerger - ) { - } + ) {} /** * @return array{coding_standard_errors?: CodingStandardError[], file_diffs?: FileDiff[], system_errors?: SystemError[]|string[], system_errors_count?: int, files_count?: int} diff --git a/src/Application/SingleFileProcessor.php b/src/Application/SingleFileProcessor.php index 1f2259981a..8360b8914c 100644 --- a/src/Application/SingleFileProcessor.php +++ b/src/Application/SingleFileProcessor.php @@ -16,8 +16,7 @@ public function __construct( private Skipper $skipper, private ChangedFilesDetector $changedFilesDetector, private FileProcessorCollector $fileProcessorCollector - ) { - } + ) {} /** * @return array{file_diffs?: FileDiff[], coding_standard_errors?: CodingStandardError[]} diff --git a/src/Blink/BlinkConfigDumper.php b/src/Blink/BlinkConfigDumper.php index 0941a1c57f..8a64e9ec37 100644 --- a/src/Blink/BlinkConfigDumper.php +++ b/src/Blink/BlinkConfigDumper.php @@ -23,8 +23,7 @@ public function __construct( private SniffFileProcessor $sniffFileProcessor, private FixerFileProcessor $fixerFileProcessor, private SkippedCriteriaResolver $skippedCriteriaResolver, - ) { - } + ) {} /** * @param string[] $paths diff --git a/src/Blink/BlinkRunner.php b/src/Blink/BlinkRunner.php index 2df97fd23d..70cdfaaa60 100644 --- a/src/Blink/BlinkRunner.php +++ b/src/Blink/BlinkRunner.php @@ -20,8 +20,7 @@ { public function __construct( private EcsGoBinaryLocator $ecsGoBinaryLocator, - ) { - } + ) {} /** * @param array{paths: string[], rules: array, skips: array} $configData diff --git a/src/Blink/EcsGoBinaryLocator.php b/src/Blink/EcsGoBinaryLocator.php index d10cbacd5d..cf68ace172 100644 --- a/src/Blink/EcsGoBinaryLocator.php +++ b/src/Blink/EcsGoBinaryLocator.php @@ -18,8 +18,7 @@ public function __construct( // filled with per-platform blink binaries by the release build, see .github/workflows/buid_release.yaml private string $bundledDirectory = __DIR__ . '/../../bin', - ) { - } + ) {} public function locate(): string { diff --git a/src/Blink/Exception/EcsGoBinaryNotFoundException.php b/src/Blink/Exception/EcsGoBinaryNotFoundException.php index 0f6f4daaed..10d0e133a2 100644 --- a/src/Blink/Exception/EcsGoBinaryNotFoundException.php +++ b/src/Blink/Exception/EcsGoBinaryNotFoundException.php @@ -6,6 +6,4 @@ use Exception; -final class EcsGoBinaryNotFoundException extends Exception -{ -} +final class EcsGoBinaryNotFoundException extends Exception {} diff --git a/src/Caching/Cache.php b/src/Caching/Cache.php index 2381d77a67..9f2df93449 100644 --- a/src/Caching/Cache.php +++ b/src/Caching/Cache.php @@ -10,8 +10,7 @@ { public function __construct( private FileCacheStorage $fileCacheStorage - ) { - } + ) {} /** * @api diff --git a/src/Caching/CacheFactory.php b/src/Caching/CacheFactory.php index af0710aa8d..51368bd519 100644 --- a/src/Caching/CacheFactory.php +++ b/src/Caching/CacheFactory.php @@ -16,8 +16,7 @@ { public function __construct( private Filesystem $fileSystem - ) { - } + ) {} /** * @api diff --git a/src/Caching/ChangedFilesDetector.php b/src/Caching/ChangedFilesDetector.php index 3e703eb8fe..e4345ac3d9 100644 --- a/src/Caching/ChangedFilesDetector.php +++ b/src/Caching/ChangedFilesDetector.php @@ -19,8 +19,7 @@ public function __construct( private FileHashComputer $fileHashComputer, private Cache $cache - ) { - } + ) {} /** * @api For tests diff --git a/src/Caching/ValueObject/CacheFilePaths.php b/src/Caching/ValueObject/CacheFilePaths.php index 73a933e1ae..e6a550ead3 100644 --- a/src/Caching/ValueObject/CacheFilePaths.php +++ b/src/Caching/ValueObject/CacheFilePaths.php @@ -10,8 +10,7 @@ public function __construct( private string $firstDirectory, private string $secondDirectory, private string $filePath - ) { - } + ) {} public function getFirstDirectory(): string { diff --git a/src/Caching/ValueObject/CacheItem.php b/src/Caching/ValueObject/CacheItem.php index f2bfbded57..ee2ad0423d 100644 --- a/src/Caching/ValueObject/CacheItem.php +++ b/src/Caching/ValueObject/CacheItem.php @@ -13,8 +13,7 @@ public function __construct( private string $variableKey, private mixed $data - ) { - } + ) {} /** * @param mixed[] $properties diff --git a/src/Caching/ValueObject/Storage/FileCacheStorage.php b/src/Caching/ValueObject/Storage/FileCacheStorage.php index 3d639d91b1..44e03110f2 100644 --- a/src/Caching/ValueObject/Storage/FileCacheStorage.php +++ b/src/Caching/ValueObject/Storage/FileCacheStorage.php @@ -19,8 +19,7 @@ public function __construct( private string $directory, private Filesystem $fileSystem - ) { - } + ) {} public function load(string $key, string $variableKey): ?string { diff --git a/src/Config/ECSConfig.php b/src/Config/ECSConfig.php index 97d9cc92f1..c285422858 100644 --- a/src/Config/ECSConfig.php +++ b/src/Config/ECSConfig.php @@ -309,7 +309,7 @@ public function findByContract(string $contractClass): array $matchingCheckers = array_filter( $checkerInstances, - static fn (object $instance): bool => $instance instanceof $contractClass + static fn(object $instance): bool => $instance instanceof $contractClass ); return [...$instances, ...array_values($matchingCheckers)]; @@ -324,7 +324,7 @@ public function getCheckerClasses(): array { return array_values(array_filter( array_keys($this->checkerConfiguration), - fn (string $checkerClass): bool => ! isset($this->removedCheckers[$checkerClass]) + fn(string $checkerClass): bool => ! isset($this->removedCheckers[$checkerClass]) )); } @@ -416,7 +416,7 @@ private function ensureCheckerClassesAreUnique(array $checkerClasses): void { // ensure all rules are registered exactly once $checkerClassToCount = array_count_values($checkerClasses); - $duplicatedCheckerClassToCount = array_filter($checkerClassToCount, static fn (int $count): bool => $count > 1); + $duplicatedCheckerClassToCount = array_filter($checkerClassToCount, static fn(int $count): bool => $count > 1); if ($duplicatedCheckerClassToCount === []) { return; diff --git a/src/Configuration/ConfigInitializer.php b/src/Configuration/ConfigInitializer.php index a7aad654a3..1ef7eb095e 100644 --- a/src/Configuration/ConfigInitializer.php +++ b/src/Configuration/ConfigInitializer.php @@ -16,13 +16,12 @@ public function __construct( private EasyCodingStandardStyle $easyCodingStandardStyle, private InitPathsResolver $initPathsResolver, private \Symfony\Component\Filesystem\Filesystem $filesystem, - ) { - } + ) {} public function areSomeCheckersRegistered(): bool { $fileProcessors = $this->fileProcessorCollector->getFileProcessors(); - return array_any($fileProcessors, fn (FileProcessorInterface $fileProcessor): bool => $fileProcessor->getCheckers() !== []); + return array_any($fileProcessors, fn(FileProcessorInterface $fileProcessor): bool => $fileProcessor->getCheckers() !== []); } public function createConfig(string $projectDirectory): void diff --git a/src/Configuration/ConfigurationFactory.php b/src/Configuration/ConfigurationFactory.php index 650b65e615..3b4d3a07d7 100644 --- a/src/Configuration/ConfigurationFactory.php +++ b/src/Configuration/ConfigurationFactory.php @@ -14,8 +14,7 @@ { public function __construct( private OutputFormatterCollector $outputFormatterCollector - ) { - } + ) {} /** * Needs to run in the start of the life cycle, since the rest of workflow uses it. diff --git a/src/Console/Command/CheckCommand.php b/src/Console/Command/CheckCommand.php index bfb4ed9289..16bf0f2604 100644 --- a/src/Console/Command/CheckCommand.php +++ b/src/Console/Command/CheckCommand.php @@ -29,8 +29,7 @@ public function __construct( private BlinkRunner $blinkRunner, private BlinkConfigDumper $blinkConfigDumper, private EasyCodingStandardStyle $easyCodingStandardStyle, - ) { - } + ) {} public function getName(): string { diff --git a/src/Console/Command/DumpConfigCommand.php b/src/Console/Command/DumpConfigCommand.php index 9ee693f091..bd0120c6bd 100644 --- a/src/Console/Command/DumpConfigCommand.php +++ b/src/Console/Command/DumpConfigCommand.php @@ -20,8 +20,7 @@ public function __construct( private ConfigurationFactory $configurationFactory, private BlinkConfigDumper $blinkConfigDumper, - ) { - } + ) {} public function getName(): string { diff --git a/src/Console/Command/ListCheckersCommand.php b/src/Console/Command/ListCheckersCommand.php index 2a022c5742..d06ddb9a88 100644 --- a/src/Console/Command/ListCheckersCommand.php +++ b/src/Console/Command/ListCheckersCommand.php @@ -22,8 +22,7 @@ public function __construct( private FixerFileProcessor $fixerFileProcessor, private CheckerListReporter $checkerListReporter, private SkippedCriteriaResolver $skippedCriteriaResolver - ) { - } + ) {} public function getName(): string { @@ -95,7 +94,7 @@ private function getSniffClasses(): array */ private function getObjectClasses(array $checkers): array { - $objectClasses = array_map(static fn (object $fixer): string => $fixer::class, $checkers); + $objectClasses = array_map(static fn(object $fixer): string => $fixer::class, $checkers); sort($objectClasses); return $objectClasses; diff --git a/src/Console/Command/WorkerCommand.php b/src/Console/Command/WorkerCommand.php index eb914eeb90..563c59b7cb 100644 --- a/src/Console/Command/WorkerCommand.php +++ b/src/Console/Command/WorkerCommand.php @@ -32,8 +32,7 @@ public function __construct( private WorkerRunner $workerRunner, private MemoryLimitter $memoryLimitter, private ConfigurationFactory $configurationFactory, - ) { - } + ) {} public function getName(): string { diff --git a/src/Console/Output/ConsoleOutputFormatter.php b/src/Console/Output/ConsoleOutputFormatter.php index 978943459b..75fac11334 100644 --- a/src/Console/Output/ConsoleOutputFormatter.php +++ b/src/Console/Output/ConsoleOutputFormatter.php @@ -19,8 +19,7 @@ public function __construct( private EasyCodingStandardStyle $easyCodingStandardStyle, private ExitCodeResolver $exitCodeResolver - ) { - } + ) {} /** * @return ExitCode::* diff --git a/src/Console/Output/JsonOutputFormatter.php b/src/Console/Output/JsonOutputFormatter.php index 60a221b7b6..fe80bb3ad9 100644 --- a/src/Console/Output/JsonOutputFormatter.php +++ b/src/Console/Output/JsonOutputFormatter.php @@ -21,8 +21,7 @@ public function __construct( private EasyCodingStandardStyle $easyCodingStandardStyle, private ExitCodeResolver $exitCodeResolver - ) { - } + ) {} /** * @return ExitCode::* diff --git a/src/Console/Reporter/CheckerListReporter.php b/src/Console/Reporter/CheckerListReporter.php index cc3c629a50..6dabd4216b 100644 --- a/src/Console/Reporter/CheckerListReporter.php +++ b/src/Console/Reporter/CheckerListReporter.php @@ -10,8 +10,7 @@ { public function __construct( private EasyCodingStandardStyle $easyCodingStandardStyle - ) { - } + ) {} /** * @param string[] $checkerClasses diff --git a/src/Console/Style/EasyCodingStandardStyle.php b/src/Console/Style/EasyCodingStandardStyle.php index 2345eb4b3b..e743c4d2dd 100644 --- a/src/Console/Style/EasyCodingStandardStyle.php +++ b/src/Console/Style/EasyCodingStandardStyle.php @@ -21,8 +21,7 @@ public function __construct( private OutputPrinter $outputPrinter, private ProgressBar $progressBar, private bool $isDebug = false, - ) { - } + ) {} public function writeln(string $message): void { diff --git a/src/DependencyInjection/ServiceContainerFactory.php b/src/DependencyInjection/ServiceContainerFactory.php index 606df86cee..91466e04de 100644 --- a/src/DependencyInjection/ServiceContainerFactory.php +++ b/src/DependencyInjection/ServiceContainerFactory.php @@ -58,7 +58,7 @@ static function (Container $container): EasyCodingStandardStyle { }); // diffing - $ecsConfig->service(DifferInterface::class, static fn (): DifferInterface => new UnifiedDiffer()); + $ecsConfig->service(DifferInterface::class, static fn(): DifferInterface => new UnifiedDiffer()); // output formatters - autodiscovered, then collected by contract for OutputFormatterCollector $ecsConfig->autodiscover(__DIR__ . '/../Console/Output'); diff --git a/src/Error/FileDiffFactory.php b/src/Error/FileDiffFactory.php index 9f34a1bbae..f391f6f62f 100644 --- a/src/Error/FileDiffFactory.php +++ b/src/Error/FileDiffFactory.php @@ -14,8 +14,7 @@ { public function __construct( private ColorConsoleDiffFormatter $colorConsoleDiffFormatter - ) { - } + ) {} /** * @param array|string> $appliedCheckers diff --git a/src/Exception/Configuration/ConflictingCheckersLoadedException.php b/src/Exception/Configuration/ConflictingCheckersLoadedException.php index dc5e26b19a..4ff797e0d7 100644 --- a/src/Exception/Configuration/ConflictingCheckersLoadedException.php +++ b/src/Exception/Configuration/ConflictingCheckersLoadedException.php @@ -6,6 +6,4 @@ use Exception; -final class ConflictingCheckersLoadedException extends Exception -{ -} +final class ConflictingCheckersLoadedException extends Exception {} diff --git a/src/Exception/Configuration/FileNotFoundException.php b/src/Exception/Configuration/FileNotFoundException.php index 1baf49ced2..0edf9632b6 100644 --- a/src/Exception/Configuration/FileNotFoundException.php +++ b/src/Exception/Configuration/FileNotFoundException.php @@ -6,6 +6,4 @@ use Exception; -final class FileNotFoundException extends Exception -{ -} +final class FileNotFoundException extends Exception {} diff --git a/src/Exception/Configuration/InitializationException.php b/src/Exception/Configuration/InitializationException.php index f21cc12d16..815d417ff0 100644 --- a/src/Exception/Configuration/InitializationException.php +++ b/src/Exception/Configuration/InitializationException.php @@ -6,6 +6,4 @@ use Exception; -final class InitializationException extends Exception -{ -} +final class InitializationException extends Exception {} diff --git a/src/Exception/Configuration/OutputFormatterNotFoundException.php b/src/Exception/Configuration/OutputFormatterNotFoundException.php index 520fd23e92..97d681a326 100644 --- a/src/Exception/Configuration/OutputFormatterNotFoundException.php +++ b/src/Exception/Configuration/OutputFormatterNotFoundException.php @@ -6,6 +6,4 @@ use Exception; -final class OutputFormatterNotFoundException extends Exception -{ -} +final class OutputFormatterNotFoundException extends Exception {} diff --git a/src/Exception/Configuration/SourceNotFoundException.php b/src/Exception/Configuration/SourceNotFoundException.php index 93687f26e2..e8624bb98b 100644 --- a/src/Exception/Configuration/SourceNotFoundException.php +++ b/src/Exception/Configuration/SourceNotFoundException.php @@ -6,6 +6,4 @@ use Exception; -final class SourceNotFoundException extends Exception -{ -} +final class SourceNotFoundException extends Exception {} diff --git a/src/Exception/Configuration/SuperfluousConfigurationException.php b/src/Exception/Configuration/SuperfluousConfigurationException.php index 8ba0be5640..bac5dc5c9e 100644 --- a/src/Exception/Configuration/SuperfluousConfigurationException.php +++ b/src/Exception/Configuration/SuperfluousConfigurationException.php @@ -6,6 +6,4 @@ use Exception; -final class SuperfluousConfigurationException extends Exception -{ -} +final class SuperfluousConfigurationException extends Exception {} diff --git a/src/Exception/Configuration/WhitespaceConfigurationException.php b/src/Exception/Configuration/WhitespaceConfigurationException.php index de0dd6e6bc..0c3c30e687 100644 --- a/src/Exception/Configuration/WhitespaceConfigurationException.php +++ b/src/Exception/Configuration/WhitespaceConfigurationException.php @@ -6,6 +6,4 @@ use Exception; -final class WhitespaceConfigurationException extends Exception -{ -} +final class WhitespaceConfigurationException extends Exception {} diff --git a/src/Exception/DeprecatedException.php b/src/Exception/DeprecatedException.php index 89d3c413f1..3e6563db83 100644 --- a/src/Exception/DeprecatedException.php +++ b/src/Exception/DeprecatedException.php @@ -9,6 +9,4 @@ /** * @api to be used */ -final class DeprecatedException extends Exception -{ -} +final class DeprecatedException extends Exception {} diff --git a/src/Exception/ShouldNotHappenException.php b/src/Exception/ShouldNotHappenException.php index 6d1a49e98c..9718e33811 100644 --- a/src/Exception/ShouldNotHappenException.php +++ b/src/Exception/ShouldNotHappenException.php @@ -6,6 +6,4 @@ use Exception; -final class ShouldNotHappenException extends Exception -{ -} +final class ShouldNotHappenException extends Exception {} diff --git a/src/Exception/VersionException.php b/src/Exception/VersionException.php index 496ae98afb..2ca3b87123 100644 --- a/src/Exception/VersionException.php +++ b/src/Exception/VersionException.php @@ -6,6 +6,4 @@ use Exception; -final class VersionException extends Exception -{ -} +final class VersionException extends Exception {} diff --git a/src/FileSystem/FileFilter.php b/src/FileSystem/FileFilter.php index 2e13f21fc3..d3fd4b0982 100644 --- a/src/FileSystem/FileFilter.php +++ b/src/FileSystem/FileFilter.php @@ -10,8 +10,7 @@ { public function __construct( private ChangedFilesDetector $changedFilesDetector - ) { - } + ) {} /** * @param string[] $filePaths diff --git a/src/FileSystem/GitDirtyFilesResolver.php b/src/FileSystem/GitDirtyFilesResolver.php index 576974340d..71e2939965 100644 --- a/src/FileSystem/GitDirtyFilesResolver.php +++ b/src/FileSystem/GitDirtyFilesResolver.php @@ -21,7 +21,7 @@ public function filterDirty(array $filePaths): array return array_values(array_filter( $filePaths, - static fn (string $filePath): bool => in_array(realpath($filePath) ?: $filePath, $dirtyFilePaths, true) + static fn(string $filePath): bool => in_array(realpath($filePath) ?: $filePath, $dirtyFilePaths, true) )); } diff --git a/src/FixerRunner/Application/FixerFileProcessor.php b/src/FixerRunner/Application/FixerFileProcessor.php index 4e285fb5d8..e24a660148 100644 --- a/src/FixerRunner/Application/FixerFileProcessor.php +++ b/src/FixerRunner/Application/FixerFileProcessor.php @@ -108,7 +108,7 @@ private function sortFixers(array $fixers): array { usort( $fixers, - static fn (FixerInterface $firstFixer, FixerInterface $secondFixer): int => $secondFixer->getPriority() <=> $firstFixer->getPriority() + static fn(FixerInterface $firstFixer, FixerInterface $secondFixer): int => $secondFixer->getPriority() <=> $firstFixer->getPriority() ); return $fixers; diff --git a/src/Parallel/Application/ParallelFileProcessor.php b/src/Parallel/Application/ParallelFileProcessor.php index 6e6f76b8c2..39f85901fc 100644 --- a/src/Parallel/Application/ParallelFileProcessor.php +++ b/src/Parallel/Application/ParallelFileProcessor.php @@ -40,8 +40,7 @@ public function __construct( private WorkerCommandLineFactory $workerCommandLineFactory, - ) { - } + ) {} /** * @api diff --git a/src/Parallel/Exception/ParallelShouldNotHappenException.php b/src/Parallel/Exception/ParallelShouldNotHappenException.php index b43d8ca47d..d55be31139 100644 --- a/src/Parallel/Exception/ParallelShouldNotHappenException.php +++ b/src/Parallel/Exception/ParallelShouldNotHappenException.php @@ -6,6 +6,4 @@ use Exception; -final class ParallelShouldNotHappenException extends Exception -{ -} +final class ParallelShouldNotHappenException extends Exception {} diff --git a/src/Parallel/ValueObject/ParallelProcess.php b/src/Parallel/ValueObject/ParallelProcess.php index 2b71d87788..0c9f84dc9b 100644 --- a/src/Parallel/ValueObject/ParallelProcess.php +++ b/src/Parallel/ValueObject/ParallelProcess.php @@ -47,8 +47,7 @@ public function __construct( private readonly string $command, private readonly LoopInterface $loop, private readonly int $timetoutInSeconds - ) { - } + ) {} /** * @param callable(mixed[] $onData) : void $onData diff --git a/src/Parallel/ValueObject/ProcessPool.php b/src/Parallel/ValueObject/ProcessPool.php index 54794b2ef9..6699bc6cdf 100644 --- a/src/Parallel/ValueObject/ProcessPool.php +++ b/src/Parallel/ValueObject/ProcessPool.php @@ -19,8 +19,7 @@ final class ProcessPool public function __construct( private readonly TcpServer $tcpServer - ) { - } + ) {} public function getProcess(string $identifier): ParallelProcess { diff --git a/src/Parallel/ValueObject/Schedule.php b/src/Parallel/ValueObject/Schedule.php index 2bf298fee9..3a1cc704f1 100644 --- a/src/Parallel/ValueObject/Schedule.php +++ b/src/Parallel/ValueObject/Schedule.php @@ -16,8 +16,7 @@ public function __construct( private int $numberOfProcesses, private array $jobs - ) { - } + ) {} public function getNumberOfProcesses(): int { diff --git a/src/Parallel/WorkerRunner.php b/src/Parallel/WorkerRunner.php index e4c71a20fe..b3553e006c 100644 --- a/src/Parallel/WorkerRunner.php +++ b/src/Parallel/WorkerRunner.php @@ -22,8 +22,7 @@ public function __construct( private SingleFileProcessor $singleFileProcessor, private ParametersMerger $parametersMerger - ) { - } + ) {} public function run(Encoder $encoder, Decoder $decoder, Configuration $configuration): void { diff --git a/src/Reporter/ProcessedFileReporter.php b/src/Reporter/ProcessedFileReporter.php index e8c10ef96a..95f16e811a 100644 --- a/src/Reporter/ProcessedFileReporter.php +++ b/src/Reporter/ProcessedFileReporter.php @@ -17,8 +17,7 @@ { public function __construct( private OutputFormatterCollector $outputFormatterCollector, - ) { - } + ) {} /** * @param array{system_errors?: SystemError[]|string[], file_diffs?: FileDiff[], coding_standard_errors?: CodingStandardError[], system_errors_count?: int, files_count?: int} $errorsAndDiffs diff --git a/src/Skipper/Matcher/FileInfoMatcher.php b/src/Skipper/Matcher/FileInfoMatcher.php index f561b8798b..972b98db3d 100644 --- a/src/Skipper/Matcher/FileInfoMatcher.php +++ b/src/Skipper/Matcher/FileInfoMatcher.php @@ -11,8 +11,7 @@ { public function __construct( private FnMatchPathNormalizer $fnMatchPathNormalizer, - ) { - } + ) {} /** * @param string[] $filePatterns @@ -21,7 +20,7 @@ public function doesFileInfoMatchPatterns(SplFileInfo|string $fileInfo, array $f { return array_any( $filePatterns, - fn (string $filePattern): bool => $this->doesFileInfoMatchPattern($fileInfo, $filePattern) + fn(string $filePattern): bool => $this->doesFileInfoMatchPattern($fileInfo, $filePattern) ); } diff --git a/src/Skipper/SkipCriteriaResolver/SkippedCriteriaResolver.php b/src/Skipper/SkipCriteriaResolver/SkippedCriteriaResolver.php index 77d33fccad..9f67a83c8f 100644 --- a/src/Skipper/SkipCriteriaResolver/SkippedCriteriaResolver.php +++ b/src/Skipper/SkipCriteriaResolver/SkippedCriteriaResolver.php @@ -38,8 +38,7 @@ final class SkippedCriteriaResolver public function __construct( private readonly PathNormalizer $pathNormalizer - ) { - } + ) {} /** * @return string[] diff --git a/src/Skipper/Skipper/SkipSkipper.php b/src/Skipper/Skipper/SkipSkipper.php index fb40a766c5..30d4e7d55c 100644 --- a/src/Skipper/Skipper/SkipSkipper.php +++ b/src/Skipper/Skipper/SkipSkipper.php @@ -14,8 +14,7 @@ { public function __construct( private FileInfoMatcher $fileInfoMatcher - ) { - } + ) {} /** * @param array $skippedClasses diff --git a/src/Skipper/Skipper/Skipper.php b/src/Skipper/Skipper/Skipper.php index f43e24c45f..b722947868 100644 --- a/src/Skipper/Skipper/Skipper.php +++ b/src/Skipper/Skipper/Skipper.php @@ -19,8 +19,7 @@ public function __construct( private SkippedCriteriaResolver $skippedCriteriaResolver, private SkipSkipper $skipSkipper, private FileInfoMatcher $fileInfoMatcher, - ) { - } + ) {} public function shouldSkipElement(string|object $element): bool { diff --git a/src/SniffRunner/Application/SniffFileProcessor.php b/src/SniffRunner/Application/SniffFileProcessor.php index dbc8a927ff..7d6b0f5874 100644 --- a/src/SniffRunner/Application/SniffFileProcessor.php +++ b/src/SniffRunner/Application/SniffFileProcessor.php @@ -167,10 +167,10 @@ private function fixFile( $appliedCheckers = $this->sniffMetadataCollector->getAppliedSniffs(); throw new RuntimeException(sprintf( - "Contents of file \"%s\" did not stabilize after %d fix iterations.\nLast diff was:\n%s\n" . - "There are probably checkers that cancel changes of each other. Try to reconfigure the checkers.\n" . - "Applied checkers:\n" . - "- %s\n", + "Contents of file \"%s\" did not stabilize after %d fix iterations.\nLast diff was:\n%s\n" + . "There are probably checkers that cancel changes of each other. Try to reconfigure the checkers.\n" + . "Applied checkers:\n" + . "- %s\n", $filePath, $this->fixer->loops, $diff, diff --git a/src/SniffRunner/File/FileFactory.php b/src/SniffRunner/File/FileFactory.php index 1d14b93f72..fe81f6a72c 100644 --- a/src/SniffRunner/File/FileFactory.php +++ b/src/SniffRunner/File/FileFactory.php @@ -21,8 +21,7 @@ public function __construct( private Skipper $skipper, private SniffMetadataCollector $sniffMetadataCollector, private EasyCodingStandardStyle $easyCodingStandardStyle - ) { - } + ) {} public function createFromFile(string $filePath): File { diff --git a/src/SniffRunner/ValueObject/Error/CodingStandardError.php b/src/SniffRunner/ValueObject/Error/CodingStandardError.php index c17aa4f1e0..9ca2e0ee85 100644 --- a/src/SniffRunner/ValueObject/Error/CodingStandardError.php +++ b/src/SniffRunner/ValueObject/Error/CodingStandardError.php @@ -14,8 +14,7 @@ public function __construct( private string $message, private string $checkerClass, private string $relativeFilePath - ) { - } + ) {} public function getLine(): int { diff --git a/src/SniffRunner/ValueObject/File.php b/src/SniffRunner/ValueObject/File.php index 62271331f1..5fa4761055 100644 --- a/src/SniffRunner/ValueObject/File.php +++ b/src/SniffRunner/ValueObject/File.php @@ -24,9 +24,9 @@ final class File extends BaseFile { private string $relativePath; - private string|null $activeSniffClass = null; + private ?string $activeSniffClass = null; - private string|null $previousActiveSniffClass = null; + private ?string $previousActiveSniffClass = null; /** * @var array diff --git a/src/Utils/ParametersMerger.php b/src/Utils/ParametersMerger.php index f21a5a5b03..1ff2bc6f6e 100644 --- a/src/Utils/ParametersMerger.php +++ b/src/Utils/ParametersMerger.php @@ -18,7 +18,7 @@ public function merge(mixed $left, mixed $right): mixed return $this->mergeLeftToRightWithCallable( $left, $right, - fn ($leftValue, $rightValue): mixed => $this->merge($leftValue, $rightValue) + fn($leftValue, $rightValue): mixed => $this->merge($leftValue, $rightValue) ); } diff --git a/src/ValueObject/Configuration.php b/src/ValueObject/Configuration.php index c40b881a1e..9722ccbdf1 100644 --- a/src/ValueObject/Configuration.php +++ b/src/ValueObject/Configuration.php @@ -20,13 +20,12 @@ public function __construct( private string $outputFormat = ConsoleOutputFormatter::NAME, private bool $isParallel = false, private ?string $config = null, - private string|null $parallelPort = null, - private string|null $parallelIdentifier = null, - private string|null $memoryLimit = null, + private ?string $parallelPort = null, + private ?string $parallelIdentifier = null, + private ?string $memoryLimit = null, private bool $showDiffs = true, private bool $isDirty = false - ) { - } + ) {} public function isFixer(): bool { diff --git a/src/ValueObject/Error/ErrorAndDiffResult.php b/src/ValueObject/Error/ErrorAndDiffResult.php index 1a88eb2f58..418454fed2 100644 --- a/src/ValueObject/Error/ErrorAndDiffResult.php +++ b/src/ValueObject/Error/ErrorAndDiffResult.php @@ -79,7 +79,7 @@ private function sortByFileAndLine(array $errorMessages): array { usort( $errorMessages, - static fn (CodingStandardError $firstCodingStandardError, CodingStandardError $secondCodingStandardError): int => [ + static fn(CodingStandardError $firstCodingStandardError, CodingStandardError $secondCodingStandardError): int => [ $firstCodingStandardError->getRelativeFilePath(), $firstCodingStandardError->getLine(), ] @@ -97,7 +97,7 @@ private function sortByFilePath(array $fileDiffs): array { uasort( $fileDiffs, - static fn (FileDiff $firstFileDiff, FileDiff $secondFileDiff): int => $firstFileDiff->getRelativeFilePath() <=> $secondFileDiff->getRelativeFilePath() + static fn(FileDiff $firstFileDiff, FileDiff $secondFileDiff): int => $firstFileDiff->getRelativeFilePath() <=> $secondFileDiff->getRelativeFilePath() ); return $fileDiffs; diff --git a/src/ValueObject/Error/FileDiff.php b/src/ValueObject/Error/FileDiff.php index dc72810fff..2befdecced 100644 --- a/src/ValueObject/Error/FileDiff.php +++ b/src/ValueObject/Error/FileDiff.php @@ -19,8 +19,7 @@ public function __construct( private readonly string $diff, private readonly string $consoleFormattedDiff, private array $appliedCheckers - ) { - } + ) {} public function getDiff(): string { diff --git a/src/ValueObject/Error/SystemError.php b/src/ValueObject/Error/SystemError.php index 122cec38d4..603e445f7e 100644 --- a/src/ValueObject/Error/SystemError.php +++ b/src/ValueObject/Error/SystemError.php @@ -13,8 +13,7 @@ public function __construct( private int $line, private string $message, private string $relativeFilePath - ) { - } + ) {} public function getMessage(): string { diff --git a/stubs/symfony-console-application.php b/stubs/symfony-console-application.php index ffd4b5700c..059881b6a7 100644 --- a/stubs/symfony-console-application.php +++ b/stubs/symfony-console-application.php @@ -16,7 +16,5 @@ */ class Application { - public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') - { - } + public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') {} } diff --git a/tests/Blink/BlinkConfigDumperTest.php b/tests/Blink/BlinkConfigDumperTest.php index e41113da30..1fa7c04e3a 100644 --- a/tests/Blink/BlinkConfigDumperTest.php +++ b/tests/Blink/BlinkConfigDumperTest.php @@ -61,7 +61,7 @@ public function testDumpReportsPathSkipAndClassSkip(): void $this->assertContains(LowercaseKeywordsFixer::class, $skipClasses); - $matchedGlob = array_filter($skipPaths, static fn (string $path): bool => str_contains($path, 'legacy')); + $matchedGlob = array_filter($skipPaths, static fn(string $path): bool => str_contains($path, 'legacy')); $this->assertNotEmpty($matchedGlob, 'expected the legacy/* path skip to be dumped'); } } diff --git a/tests/Blink/Fixture/input/Sample.php b/tests/Blink/Fixture/input/Sample.php index d9f87a9d02..061bd519b2 100644 --- a/tests/Blink/Fixture/input/Sample.php +++ b/tests/Blink/Fixture/input/Sample.php @@ -1,3 +1,3 @@ $command::class, + static fn(object $command): string => $command::class, $this->commandRegistry->getVisible() ); diff --git a/tests/Console/Output/Source/RandomFile.php b/tests/Console/Output/Source/RandomFile.php index d28237dae2..78d287ad17 100644 --- a/tests/Console/Output/Source/RandomFile.php +++ b/tests/Console/Output/Source/RandomFile.php @@ -4,6 +4,4 @@ namespace Symplify\EasyCodingStandard\Tests\Console\Output\Source; -final class RandomFile -{ -} +final class RandomFile {} diff --git a/tests/Console/Output/Source/RandomFileWithEditsAndSimpleOffset.php b/tests/Console/Output/Source/RandomFileWithEditsAndSimpleOffset.php index a7b30ecafb..705d9d8af6 100644 --- a/tests/Console/Output/Source/RandomFileWithEditsAndSimpleOffset.php +++ b/tests/Console/Output/Source/RandomFileWithEditsAndSimpleOffset.php @@ -1,7 +1,5 @@