From 222d286dae809e10971d1ae8582e293c78afad9f Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 30 Jul 2026 12:10:01 +0200 Subject: [PATCH] bump dev dependencies, PHPUnit 13 Run composer update and vendor/bin/jack raise-to-installed, then composer fix-cs for the newer easy-coding-standard rules. PHPUnit 13 ignores a RequiresPhp version without a comparison operator, which made the PHP 8.5 only tests run everywhere. --- composer.json | 14 +++++++------- .../DowngradeVoidCastRectorTest.php | 2 +- .../DowngradePipeOperatorRectorTest.php | 2 +- .../DowngradeParameterTypeWideningRector.php | 2 +- .../DowngradeListReferenceAssignmentRector.php | 10 +++++----- .../DowngradeContravariantArgumentTypeRector.php | 4 ++-- .../DowngradeCovariantReturnTypeRector.php | 4 ++-- .../DowngradeStripTagsCallWithArrayRector.php | 4 ++-- .../DowngradeNumericLiteralSeparatorRector.php | 2 +- .../NodeAnalyzer/NamedToUnnamedArgs.php | 2 +- .../NodeAnalyzer/UnnamedArgumentResolver.php | 2 +- .../DowngradeAttributeToAnnotationRector.php | 2 +- .../Expression/DowngradeMatchToSwitchRector.php | 4 ++-- .../Rector/Expression/DowngradeThrowExprRector.php | 2 +- .../Rector/FuncCall/DowngradeStrContainsRector.php | 4 ++-- .../MethodCall/DowngradeNamedArgumentRector.php | 2 +- ...radeReflectionClassGetConstantsFilterRector.php | 2 +- .../Reflection/DefaultParameterValueResolver.php | 4 ++-- .../Class_/DowngradeUnionIntersectionRector.php | 6 +++--- 19 files changed, 37 insertions(+), 37 deletions(-) diff --git a/composer.json b/composer.json index b089ccc0..91d4afb0 100644 --- a/composer.json +++ b/composer.json @@ -9,21 +9,21 @@ "require-dev": { "boundwize/structarmed": "^0.14", "phpstan/extension-installer": "^1.4", - "phpstan/phpstan": "^2.1.33", + "phpstan/phpstan": "^2.2", "phpstan/phpstan-webmozart-assert": "^2.0", - "phpunit/phpunit": "^11.5", - "rector/jack": "^0.5.1", + "phpunit/phpunit": "^13.2", + "rector/jack": "^1.0", "rector/rector-src": "dev-main", - "rector/swiss-knife": "^2.3", - "symplify/easy-coding-standard": "^13.0", + "rector/swiss-knife": "^2.4", + "symplify/easy-coding-standard": "^13.2", "symplify/phpstan-extensions": "^12.0", - "symplify/phpstan-rules": "^14.9", + "symplify/phpstan-rules": "^14.12", "symplify/rule-doc-generator": "^12.2", "symplify/vendor-patches": "^11.5", "tomasvotruba/class-leak": "^2.1", "tomasvotruba/type-coverage": "^2.3", "tomasvotruba/unused-public": "^2.2", - "tracy/tracy": "^2.11" + "tracy/tracy": "^2.12" }, "autoload": { "psr-4": { diff --git a/rules-tests/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector/DowngradeVoidCastRectorTest.php b/rules-tests/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector/DowngradeVoidCastRectorTest.php index 51fd6f39..1abbb367 100644 --- a/rules-tests/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector/DowngradeVoidCastRectorTest.php +++ b/rules-tests/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector/DowngradeVoidCastRectorTest.php @@ -12,7 +12,7 @@ final class DowngradeVoidCastRectorTest extends AbstractRectorTestCase { #[DataProvider('provideData')] - #[RequiresPhp('8.5')] + #[RequiresPhp('>= 8.5.0')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/rules-tests/DowngradePhp85/Rector/StmtsAwareInterface/DowngradePipeOperatorRector/DowngradePipeOperatorRectorTest.php b/rules-tests/DowngradePhp85/Rector/StmtsAwareInterface/DowngradePipeOperatorRector/DowngradePipeOperatorRectorTest.php index 448e8575..72c92c89 100644 --- a/rules-tests/DowngradePhp85/Rector/StmtsAwareInterface/DowngradePipeOperatorRector/DowngradePipeOperatorRectorTest.php +++ b/rules-tests/DowngradePhp85/Rector/StmtsAwareInterface/DowngradePipeOperatorRector/DowngradePipeOperatorRectorTest.php @@ -12,7 +12,7 @@ final class DowngradePipeOperatorRectorTest extends AbstractRectorTestCase { #[DataProvider('provideData')] - #[RequiresPhp('>= 8.5')] + #[RequiresPhp('>= 8.5.0')] public function test(string $filePath): void { $this->doTestFile($filePath); diff --git a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php index 37a8987a..c94b49b2 100644 --- a/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php +++ b/rules/DowngradePhp72/Rector/ClassMethod/DowngradeParameterTypeWideningRector.php @@ -211,7 +211,7 @@ private function removeParamTypeFromMethod(ClassMethod $classMethod, int $paramP private function hasParamAlreadyNonTyped(ClassMethod $classMethod): bool { - return array_all($classMethod->params, fn(Param $param): bool => !$param->type instanceof Node); + return array_all($classMethod->params, static fn (Param $param): bool => ! $param->type instanceof Node); } private function isSafeType(ClassReflection $classReflection, ClassMethod $classMethod): bool diff --git a/rules/DowngradePhp73/Rector/List_/DowngradeListReferenceAssignmentRector.php b/rules/DowngradePhp73/Rector/List_/DowngradeListReferenceAssignmentRector.php index 866c97dd..dd9fbf2a 100644 --- a/rules/DowngradePhp73/Rector/List_/DowngradeListReferenceAssignmentRector.php +++ b/rules/DowngradePhp73/Rector/List_/DowngradeListReferenceAssignmentRector.php @@ -130,7 +130,7 @@ public function refactor(Node $node): ?array * Remove the right-side-most params by reference or empty from `list()`, * since they are not needed anymore. */ - private function removeStaleParams(List_ | Array_ $node, int $rightSideRemovableParamsCount): void + private function removeStaleParams(List_|Array_ $node, int $rightSideRemovableParamsCount): void { $nodeItemsCount = count($node->items); if ($rightSideRemovableParamsCount > 0) { @@ -138,7 +138,7 @@ private function removeStaleParams(List_ | Array_ $node, int $rightSideRemovable } } - private function shouldSkipAssign(Assign $assign, List_ | Array_ $arrayOrList): bool + private function shouldSkipAssign(Assign $assign, List_|Array_ $arrayOrList): bool { if (! $assign->expr instanceof Variable) { return true; @@ -264,7 +264,7 @@ private function hasAllItemsByRef(array $items): bool /** * Return the key inside the ArrayItem, if provided, or the position otherwise */ - private function getArrayItemKey(ArrayItem $arrayItem, int | string $position): int | string + private function getArrayItemKey(ArrayItem $arrayItem, int|string $position): int|string { if ($arrayItem->key instanceof String_) { return $arrayItem->key->value; @@ -285,7 +285,7 @@ private function createAssignRefWithArrayDimFetch( Variable $assignVariable, Variable $exprVariable, array $nestedArrayIndexes, - string | int $arrayIndex + string|int $arrayIndex ): Expression { $nestedExprVariable = $exprVariable; foreach ($nestedArrayIndexes as $nestedArrayIndex) { @@ -301,7 +301,7 @@ private function createAssignRefWithArrayDimFetch( } /** - * @param array<(ArrayItem | null)> $arrayItems + * @param array<(ArrayItem|null)> $arrayItems * @return ArrayItem[] */ private function getItemsByRef(array $arrayItems, int $condition): array diff --git a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php index 7015ed88..49d13983 100644 --- a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php +++ b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeContravariantArgumentTypeRector.php @@ -248,7 +248,7 @@ private function getDifferentParamTypeFromReflectionMethod( return null; } - private function refactorParam(Param $param, ClassMethod | Function_ $functionLike): void + private function refactorParam(Param $param, ClassMethod|Function_ $functionLike): void { if (! $this->isNullableParam($param, $functionLike)) { return; @@ -260,7 +260,7 @@ private function refactorParam(Param $param, ClassMethod | Function_ $functionLi $this->hasChanged = true; } - private function decorateWithDocBlock(ClassMethod | Function_ $functionLike, Param $param): void + private function decorateWithDocBlock(ClassMethod|Function_ $functionLike, Param $param): void { if (! $param->type instanceof Node) { return; diff --git a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php index c3505300..ff2e481a 100644 --- a/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php +++ b/rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php @@ -155,7 +155,7 @@ public function refactor(Node $node): ?Node private function resolveDifferentAncestorReturnType( ClassMethod $classMethod, - UnionType | NullableType | Name | Identifier | ComplexType $returnTypeNode + UnionType|NullableType|Name|Identifier|ComplexType $returnTypeNode ): Type { $classReflection = $this->reflectionResolver->resolveClassReflection($classMethod); if (! $classReflection instanceof ClassReflection) { @@ -261,6 +261,6 @@ private function isNullable(Type $parentReturnType, Type $returnType): bool return false; } - return array_any($parentReturnType->getTypes(), fn(Type $type): bool => $type->equals($returnType)); + return array_any($parentReturnType->getTypes(), static fn (Type $type): bool => $type->equals($returnType)); } } diff --git a/rules/DowngradePhp74/Rector/FuncCall/DowngradeStripTagsCallWithArrayRector.php b/rules/DowngradePhp74/Rector/FuncCall/DowngradeStripTagsCallWithArrayRector.php index da5c7562..301a20c0 100644 --- a/rules/DowngradePhp74/Rector/FuncCall/DowngradeStripTagsCallWithArrayRector.php +++ b/rules/DowngradePhp74/Rector/FuncCall/DowngradeStripTagsCallWithArrayRector.php @@ -143,7 +143,7 @@ private function shouldSkipFuncCall(FuncCall $funcCall): bool } private function createArrayFromString( - Array_ | Variable | PropertyFetch | ConstFetch | ClassConstFetch $expr + Array_|Variable|PropertyFetch|ConstFetch|ClassConstFetch $expr ): Concat { $args = [new Arg(new String_('><')), new Arg($expr)]; $implodeFuncCall = new FuncCall(new Name('implode'), $args); @@ -153,7 +153,7 @@ private function createArrayFromString( } private function createIsArrayTernaryFromExpression( - Variable | PropertyFetch | ConstFetch | ClassConstFetch $expr + Variable|PropertyFetch|ConstFetch|ClassConstFetch $expr ): Ternary { $isArrayFuncCall = new FuncCall(new Name('is_array'), [new Arg($expr)]); $nullNotIdentical = new NotIdentical($expr, $this->nodeFactory->createNull()); diff --git a/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php b/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php index e288b7bd..f2c581e6 100644 --- a/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php +++ b/rules/DowngradePhp74/Rector/LNumber/DowngradeNumericLiteralSeparatorRector.php @@ -81,7 +81,7 @@ public function refactor(Node $node): ?Node return $node; } - private function shouldSkip(Int_ | Float_ $node, mixed $rawValue): bool + private function shouldSkip(Int_|Float_ $node, mixed $rawValue): bool { if (! is_string($rawValue)) { return true; diff --git a/rules/DowngradePhp80/NodeAnalyzer/NamedToUnnamedArgs.php b/rules/DowngradePhp80/NodeAnalyzer/NamedToUnnamedArgs.php index 8f3f1567..27ab4732 100644 --- a/rules/DowngradePhp80/NodeAnalyzer/NamedToUnnamedArgs.php +++ b/rules/DowngradePhp80/NodeAnalyzer/NamedToUnnamedArgs.php @@ -70,7 +70,7 @@ public function fillFromNamedArgs( * @return array */ public function fillFromJumpedNamedArgs( - FunctionReflection | MethodReflection | ReflectionFunction $functionLikeReflection, + FunctionReflection|MethodReflection|ReflectionFunction $functionLikeReflection, array $unnamedArgs, array $parameters ): array { diff --git a/rules/DowngradePhp80/NodeAnalyzer/UnnamedArgumentResolver.php b/rules/DowngradePhp80/NodeAnalyzer/UnnamedArgumentResolver.php index 2e59ab71..8320417f 100644 --- a/rules/DowngradePhp80/NodeAnalyzer/UnnamedArgumentResolver.php +++ b/rules/DowngradePhp80/NodeAnalyzer/UnnamedArgumentResolver.php @@ -26,7 +26,7 @@ public function __construct( * @return Arg[] */ public function resolveFromReflection( - FunctionReflection | MethodReflection $functionLikeReflection, + FunctionReflection|MethodReflection $functionLikeReflection, array $currentArgs ): array { $extendedParametersAcceptor = ParametersAcceptorSelector::combineAcceptors( diff --git a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php index 88948308..c5e0da8c 100644 --- a/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php +++ b/rules/DowngradePhp80/Rector/Class_/DowngradeAttributeToAnnotationRector.php @@ -207,7 +207,7 @@ private function resolveIndentation(Node $node, AttributeGroup $attributeGroup, } private function cleanupEmptyAttrGroups( - ClassMethod | Property | Class_ | Interface_ | Param | Function_ $node + ClassMethod|Property|Class_|Interface_|Param|Function_ $node ): void { foreach ($node->attrGroups as $key => $attrGroup) { if ($attrGroup->attrs !== []) { diff --git a/rules/DowngradePhp80/Rector/Expression/DowngradeMatchToSwitchRector.php b/rules/DowngradePhp80/Rector/Expression/DowngradeMatchToSwitchRector.php index b9171bf1..af41c0ff 100644 --- a/rules/DowngradePhp80/Rector/Expression/DowngradeMatchToSwitchRector.php +++ b/rules/DowngradePhp80/Rector/Expression/DowngradeMatchToSwitchRector.php @@ -282,7 +282,7 @@ private function refactorInArrowFunction( * @return Case_[] */ private function createSwitchCasesFromMatchArms( - Echo_ | Expression | Return_ $node, + Echo_|Expression|Return_ $node, Match_ $match, bool $isInsideArrayItem = false ): array { @@ -312,7 +312,7 @@ private function createSwitchCasesFromMatchArms( * @return Stmt[] */ private function createSwitchStmts( - Echo_ | Expression | Return_ $node, + Echo_|Expression|Return_ $node, MatchArm $matchArm, bool $isInsideArrayItem ): array { diff --git a/rules/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector.php b/rules/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector.php index 429d24f1..07c02291 100644 --- a/rules/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector.php +++ b/rules/DowngradePhp80/Rector/Expression/DowngradeThrowExprRector.php @@ -150,7 +150,7 @@ private function refactorArrowFunctionReturn(ArrowFunction $arrowFunction): ?Clo /** * @return If_|Expression|Stmt[]|null */ - private function refactorAssign(Assign $assign): If_ | Expression | null | array + private function refactorAssign(Assign $assign): If_|Expression|null|array { if (! $this->hasThrowInAssignExpr($assign)) { return null; diff --git a/rules/DowngradePhp80/Rector/FuncCall/DowngradeStrContainsRector.php b/rules/DowngradePhp80/Rector/FuncCall/DowngradeStrContainsRector.php index eae0e7bd..18cb98af 100644 --- a/rules/DowngradePhp80/Rector/FuncCall/DowngradeStrContainsRector.php +++ b/rules/DowngradePhp80/Rector/FuncCall/DowngradeStrContainsRector.php @@ -62,7 +62,7 @@ public function getNodeTypes(): array * @param FuncCall|BooleanNot $node * @return Identical|NotIdentical|null The refactored node. */ - public function refactor(Node $node): Identical | NotIdentical | null + public function refactor(Node $node): Identical|NotIdentical|null { $funcCall = $this->matchStrContainsOrNotStrContains($node); @@ -87,7 +87,7 @@ public function refactor(Node $node): Identical | NotIdentical | null return new NotIdentical($funcCall, $this->nodeFactory->createFalse()); } - private function matchStrContainsOrNotStrContains(FuncCall | BooleanNot $expr): ?FuncCall + private function matchStrContainsOrNotStrContains(FuncCall|BooleanNot $expr): ?FuncCall { $expr = ($expr instanceof BooleanNot) ? $expr->expr : $expr; if (! $expr instanceof FuncCall) { diff --git a/rules/DowngradePhp80/Rector/MethodCall/DowngradeNamedArgumentRector.php b/rules/DowngradePhp80/Rector/MethodCall/DowngradeNamedArgumentRector.php index 0b3013dc..ea6d519b 100644 --- a/rules/DowngradePhp80/Rector/MethodCall/DowngradeNamedArgumentRector.php +++ b/rules/DowngradePhp80/Rector/MethodCall/DowngradeNamedArgumentRector.php @@ -94,7 +94,7 @@ public function refactor(Node $node): ?Node /** * @param Arg[] $args */ - private function removeNamedArguments(MethodCall | StaticCall | New_ | FuncCall $node, array $args): ?Node + private function removeNamedArguments(MethodCall|StaticCall|New_|FuncCall $node, array $args): ?Node { if ($node instanceof New_) { $functionLikeReflection = $this->reflectionResolver->resolveMethodReflectionFromNew($node); diff --git a/rules/DowngradePhp80/Rector/MethodCall/DowngradeReflectionClassGetConstantsFilterRector.php b/rules/DowngradePhp80/Rector/MethodCall/DowngradeReflectionClassGetConstantsFilterRector.php index ee03663f..4b6b3dda 100644 --- a/rules/DowngradePhp80/Rector/MethodCall/DowngradeReflectionClassGetConstantsFilterRector.php +++ b/rules/DowngradePhp80/Rector/MethodCall/DowngradeReflectionClassGetConstantsFilterRector.php @@ -299,7 +299,7 @@ private function createIfs( /** * @return string[] */ - private function resolveClassConstFetchNames(ClassConstFetch | BitwiseOr $value): array + private function resolveClassConstFetchNames(ClassConstFetch|BitwiseOr $value): array { if ($value instanceof ClassConstFetch) { $classConstFetchNames = []; diff --git a/rules/DowngradePhp80/Reflection/DefaultParameterValueResolver.php b/rules/DowngradePhp80/Reflection/DefaultParameterValueResolver.php index a61b349b..2d91f867 100644 --- a/rules/DowngradePhp80/Reflection/DefaultParameterValueResolver.php +++ b/rules/DowngradePhp80/Reflection/DefaultParameterValueResolver.php @@ -20,7 +20,7 @@ final class DefaultParameterValueResolver { - public function resolveFromParameterReflection(ParameterReflection $parameterReflection): Expr | null + public function resolveFromParameterReflection(ParameterReflection $parameterReflection): Expr|null { $defaultValueType = $parameterReflection->getDefaultValue(); if (! $defaultValueType instanceof Type) { @@ -34,7 +34,7 @@ public function resolveFromParameterReflection(ParameterReflection $parameterRef return $this->resolveValueFromType($defaultValueType); } - private function resolveValueFromType(Type $constantType): ConstFetch | Expr + private function resolveValueFromType(Type $constantType): ConstFetch|Expr { if ($constantType instanceof ConstantBooleanType) { return $this->resolveConstantBooleanType($constantType); diff --git a/rules/DowngradePhp82/Rector/Class_/DowngradeUnionIntersectionRector.php b/rules/DowngradePhp82/Rector/Class_/DowngradeUnionIntersectionRector.php index 1acdb235..1898352e 100644 --- a/rules/DowngradePhp82/Rector/Class_/DowngradeUnionIntersectionRector.php +++ b/rules/DowngradePhp82/Rector/Class_/DowngradeUnionIntersectionRector.php @@ -4,12 +4,12 @@ namespace Rector\DowngradePhp82\Rector\Class_; -use PhpParser\Node\Identifier; -use PhpParser\Node\Name; use PhpParser\Node; use PhpParser\Node\Expr\ArrowFunction; use PhpParser\Node\Expr\Closure; +use PhpParser\Node\Identifier; use PhpParser\Node\IntersectionType; +use PhpParser\Node\Name; use PhpParser\Node\Stmt\ClassLike; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Function_; @@ -137,6 +137,6 @@ private function isUnionIntersection(?Node $node): bool return false; } - return array_any($node->types, fn(Identifier|Name|IntersectionType $type): bool => $type instanceof IntersectionType); + return array_any($node->types, static fn (Identifier|Name|IntersectionType $type): bool => $type instanceof IntersectionType); } }