From 2b42ae9a98bb2aa8719b6c988f5e9b23ec0b977a Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 19 Jun 2026 12:56:18 +0200 Subject: [PATCH 1/4] bump deps to PHP 8.4 --- composer.json | 13 +++++-------- phpstan.neon | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/composer.json b/composer.json index 696ea08853f..0cd32612cb1 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "migration" ], "require": { - "php": "^8.3", + "php": "^8.4", "clue/ndjson-react": "^1.3", "composer/pcre": "^3.4.0", "composer/semver": "^3.4", @@ -51,14 +51,12 @@ "phpstan/phpstan-phpunit": "^2.0", "phpstan/phpstan-webmozart-assert": "^2.0", "phpunit/phpunit": "^12.5.6", - "rector/jack": "^0.5", - "rector/release-notes-generator": "^0.5.1", + "rector/jack": "^1.0", "rector/swiss-knife": "^2.4.1", "rector/type-perfect": "^2.1.2", "shipmonk/composer-dependency-analyser": "^1.8", - "symplify/easy-coding-standard": "^13.1", - "symplify/phpstan-extensions": "^12.0.2", - "symplify/phpstan-rules": "^14.9.11", + "symplify/easy-coding-standard": "^13.2", + "symplify/phpstan-rules": "^14.12", "symplify/vendor-patches": "^11.5", "tomasvotruba/class-leak": "^2.1", "tomasvotruba/unused-public": "^2.2", @@ -118,8 +116,7 @@ "fix-cs": "vendor/bin/ecs check --fix --ansi", "phpstan": "vendor/bin/phpstan analyse --ansi --memory-limit=512M", "rector": "bin/rector process --ansi", - "preload": "php build/build-preload.php .", - "release": "vendor/bin/rng --from-commit X --to-commit Y --remote-repository rectorphp/rector-symfony --remote-repository rectorphp/rector-doctrine --remote-repository rectorphp/rector-phpunit" + "preload": "php build/build-preload.php ." }, "extra": { "patches": { diff --git a/phpstan.neon b/phpstan.neon index 6585a348409..7b4fd512d2b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -25,6 +25,12 @@ parameters: checkMissingCallableSignature: true treatPhpDocTypesAsCertain: false + symplify: + symfonyReturnType: true + laravelReturnType: true + pathStrings: true + ctor: true + paths: - rector.php - bin @@ -344,12 +350,13 @@ parameters: # list vs array - '#Parameter (.*?) expects list<(.*?)>, array<(.*?)> given#' - - identifier: symplify.noConstructorOverride - path: src/StaticTypeMapper/ValueObject/Type/SimpleStaticType.php - - - identifier: arrayValues.list - path: rules/CodingStyle/Application/UseImportsAdder.php + identifier: symplify.noConstructorOverride + path: src/StaticTypeMapper/ValueObject/Type/SimpleStaticType.php + +# - +# identifier: arrayValues.list +# path: rules/CodingStyle/Application/UseImportsAdder.php - message: '#Offset float\|int\|string might not exist on string#' @@ -449,8 +456,9 @@ parameters: - '#Provide more specific return type "Iterator|PhpParser\\Node" over abstract one#' - # BC layer + # false positive - +<<<<<<< HEAD message: '#Access to deprecated property \$file of class Rector\\Rector\\AbstractRector#' path: src/Rector/AbstractRector.php @@ -458,3 +466,7 @@ parameters: - message: '#"@\\simplexml_load_string\(\$junitXml\)" is forbidden to use#' path: scripts/remove-unused-deps.php +======= + path: src/Util/Reflection/PrivatesAccessor.php + identifier: symplify.newOverSetters +>>>>>>> 16ebfd1c27 (bump deps to PHP 8.4) From 6ed404ac1e26fe1fe80fcbc9a6da597c2a578c87 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 19 Jun 2026 13:05:07 +0200 Subject: [PATCH 2/4] [php] bump to PHP 8.4 syntax --- build/build-preload.php | 4 ++-- config/config.php | 2 +- phpstan.neon | 1 + .../Catch_/ThrowWithPreviousExceptionRector.php | 8 ++++++++ .../ChangeArrayPushToArrayAssignRector.php | 4 ++++ .../ValueObject/PendingImports.php | 9 +++++++++ ...FunctionAndClosureFirstClassCallableGuard.php | 8 ++++++++ .../NodeAnalyzer/NoDiscardCallAnalyzer.php | 4 ++++ .../PhpDoc/Guard/TemplateTypeRemovalGuard.php | 4 ++++ .../RemoveUnusedPrivateClassConstantRector.php | 4 ++++ .../RemoveTypedPropertyNonMockDocblockRector.php | 6 ++++++ .../NarrowWideUnionReturnTypeRector.php | 4 ++++ .../RemoveDuplicatedCaseInSwitchRector.php | 4 ++++ .../TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php | 4 ++++ .../Rector/If_/RemoveAlwaysElseRector.php | 3 +++ rules/Naming/VariableRenamer.php | 3 +++ .../Rector/List_/ListToArrayDestructRector.php | 4 ++++ .../ClosureArrowFunctionAnalyzer.php | 3 +++ rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php | 8 ++++++++ rules/Php80/NodeAnalyzer/SwitchAnalyzer.php | 4 ++++ ...ropertyAssignToConstructorPromotionRector.php | 4 ++++ .../ValueObject/NestedAnnotationToAttribute.php | 4 ++++ .../NodeManipulator/ReadonlyClassManipulator.php | 16 ++++++++++++++++ .../Rector/ClassConst/AddTypeToConstRector.php | 4 ++++ .../Rector/FuncCall/AddEscapeArgumentRector.php | 4 ++++ .../Guard/OverrideByParentClassGuard.php | 6 ++++++ .../ClassMethodVisibilityGuard.php | 4 ++++ ...lReturnTypeFromBooleanStrictReturnsRector.php | 6 ++++++ .../ParamTypeByMethodCallTypeRector.php | 4 ++++ .../StrictArrayParamDimFetchRector.php | 12 ++++++++++++ ...ngReturnTypeFromStrictStringReturnsRector.php | 4 ++++ ...sureParamTypeFromIterableMethodCallRector.php | 4 ++++ .../GenericClassStringTypeNormalizer.php | 4 ++++ ...DocblockForDimFetchArrayFromAssignsRector.php | 4 ++++ scripts/no-php-file-in-fixtures.php | 4 ++-- .../Guard/NewPhpDocFromPHPStanTypeGuard.php | 4 ++++ .../Printer/PhpDocInfoPrinter.php | 4 ++++ .../ValueObject/Parser/BetterTokenIterator.php | 4 ++++ src/Bootstrap/AutoloadFileParameterResolver.php | 3 ++- src/Configuration/RectorConfigBuilder.php | 3 ++- src/Configuration/VendorMissAnalyseGuard.php | 6 ++++++ src/CustomRules/SimpleNodeDumper.php | 4 ++++ .../NodeAnalyzer/ClassChildAnalyzer.php | 7 +++++++ src/NodeAnalyzer/ArgsAnalyzer.php | 4 ++++ src/NodeAnalyzer/CallAnalyzer.php | 8 ++++++++ src/NodeAnalyzer/CallLikeArgumentNameAdder.php | 3 +++ src/NodeAnalyzer/DoctrineEntityAnalyzer.php | 6 ++++++ src/NodeAnalyzer/ParamAnalyzer.php | 8 ++++++++ src/NodeAnalyzer/ScopeAnalyzer.php | 4 ++++ src/NodeAnalyzer/VariadicAnalyzer.php | 4 ++++ .../ClassDependencyManipulator.php | 9 +++++++++ src/NodeManipulator/ClassMethodManipulator.php | 6 ++++++ src/NodeNameResolver/NodeNameResolver.php | 3 +++ .../PHPStan/Type/StaticTypeAnalyzer.php | 3 +++ .../AnnotationToAttributeIntegerValueCaster.php | 4 ++++ src/PhpParser/Enum/NodeGroup.php | 4 ++++ src/PhpParser/Node/BetterNodeFinder.php | 4 ++++ src/PhpParser/Node/FileNode.php | 8 ++++++++ src/PhpParser/Node/Value/ValueResolver.php | 4 ++++ .../ClassMethodParamVendorLockResolver.php | 4 ++++ 60 files changed, 289 insertions(+), 7 deletions(-) diff --git a/build/build-preload.php b/build/build-preload.php index e35185370f8..80a2e084ffc 100755 --- a/build/build-preload.php +++ b/build/build-preload.php @@ -216,7 +216,7 @@ private function buildPreloadScriptPhpParser(string $buildDirectory, string $pre */ private function findPhpParserFiles(string $vendorDir): array { - $finder = (new Finder()) + $finder = new Finder() ->files() ->name('*.php') ->in($vendorDir . '/nikic/php-parser/lib/PhpParser') @@ -233,7 +233,7 @@ private function findPhpParserFiles(string $vendorDir): array */ private function findPhpDocParserFiles(string $vendorDir): array { - $finder = (new Finder()) + $finder = new Finder() ->files() ->name('*.php') ->in($vendorDir . '/phpstan/phpdoc-parser') diff --git a/config/config.php b/config/config.php index fa62bbed1f5..b1afe8533af 100644 --- a/config/config.php +++ b/config/config.php @@ -29,7 +29,7 @@ // use faster in-memory cache in CI. // CI always starts from scratch, therefore IO intensive caching is not worth it - if ((new CiDetector())->isCiDetected()) { + if (new CiDetector()->isCiDetected()) { $rectorConfig->cacheClass(MemoryCacheStorage::class); } diff --git a/phpstan.neon b/phpstan.neon index 7b4fd512d2b..38c48149cd5 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -25,6 +25,7 @@ parameters: checkMissingCallableSignature: true treatPhpDocTypesAsCertain: false + # see https://github.com/symplify/phpstan-rules symplify: symfonyReturnType: true laravelReturnType: true diff --git a/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php b/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php index 0ce0dad3fd3..e571ac4a19e 100644 --- a/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php +++ b/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php @@ -236,7 +236,11 @@ private function hasParameter(New_ $new, string $parameterName): bool ); return array_any( $extendedParametersAcceptor->getParameters(), +<<<<<<< HEAD fn (ExtendedParameterReflection $extendedParameterReflection): bool => $extendedParameterReflection->getName() === $parameterName +======= + fn ($extendedParameterReflection): bool => $extendedParameterReflection->getName() === $parameterName +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -244,7 +248,11 @@ private function hasArgument(New_ $new, string $argumentName): bool { return array_any( $new->getArgs(), +<<<<<<< HEAD fn (Arg $arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === $argumentName +======= + fn ($arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === $argumentName +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php b/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php index 309ea2428f2..13710a213b9 100644 --- a/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php +++ b/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php @@ -101,6 +101,10 @@ public function refactor(Node $node): ?array private function hasArraySpread(FuncCall $funcCall): bool { +<<<<<<< HEAD return array_any($funcCall->getArgs(), fn (Arg $arg): bool => $arg->unpack); +======= + return array_any($funcCall->getArgs(), fn ($arg) => $arg->unpack); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php b/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php index 4920eeeb450..192740d5a02 100644 --- a/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php +++ b/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php @@ -98,12 +98,18 @@ public function isShortImported(FullyQualifiedObjectType $fullyQualifiedObjectTy return true; } } +<<<<<<< HEAD return array_any( $this->functionImports, fn (FullyQualifiedObjectType $fullyQualifiedObjectType): bool => strtolower( $fullyQualifiedObjectType->getShortName() ) === $shortName +======= + return array_any( + $this->functionImports, + fn ($functionImport): bool => strtolower((string) $functionImport->getShortName()) === $shortName +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -120,7 +126,10 @@ public function isImportShortable(FullyQualifiedObjectType $fullyQualifiedObject return true; } } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any($this->functionImports, fn (Type $type): bool => $fullyQualifiedObjectType->equals($type)); } } diff --git a/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php b/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php index 9cea1b90e14..a20f27fc348 100644 --- a/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php +++ b/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php @@ -189,7 +189,11 @@ private function isUsingThisInNonObjectContext(FuncCall|MethodCall|StaticCall $c */ private function isUsingByRef(array $params): bool { +<<<<<<< HEAD return array_any($params, fn (Param $param): bool => $param->byRef); +======= + return array_any($params, fn ($param) => $param->byRef); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -197,7 +201,11 @@ private function isUsingByRef(array $params): bool */ private function isUsingNamedArgs(array $args): bool { +<<<<<<< HEAD return array_any($args, fn (Arg $arg): bool => $arg->name instanceof Identifier); +======= + return array_any($args, fn ($arg): bool => $arg->name instanceof Identifier); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function isChainedCall(FuncCall|MethodCall|StaticCall $callLike): bool diff --git a/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php b/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php index 5bc416d7f26..c4269d5ff5f 100644 --- a/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php +++ b/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php @@ -85,9 +85,13 @@ public function isNoDiscardCall(Expr $expr): bool */ private function hasNoDiscardAttribute(array $attributes): bool { +<<<<<<< HEAD return array_any( $attributes, fn (AttributeReflection $attributeReflection): bool => $attributeReflection->getName() === 'NoDiscard' ); +======= + return array_any($attributes, fn ($attribute): bool => $attribute->getName() === 'NoDiscard'); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php b/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php index ddba64e1666..50bac5a34d3 100644 --- a/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php +++ b/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php @@ -21,6 +21,10 @@ public function isLegal(Type $docType): bool $types = $docType instanceof UnionType ? $docType->getTypes() : [$docType]; +<<<<<<< HEAD return array_all($types, fn (Type $type): bool => ! $type instanceof TemplateType); +======= + return array_all($types, fn ($type): bool => ! $type instanceof TemplateType); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php b/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php index 74758264ba1..617b4dbbcdd 100644 --- a/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php +++ b/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php @@ -106,7 +106,11 @@ private function hasParentClassOfEnumSuffix(ClassReflection $classReflection): b { return array_any( $classReflection->getParentClassesNames(), +<<<<<<< HEAD fn (string $parentClassesName): bool => str_ends_with($parentClassesName, 'Enum') +======= + fn ($parentClassesName): bool => str_ends_with((string) $parentClassesName, 'Enum') +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php b/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php index 3bec4b1de46..cae3898681b 100644 --- a/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php +++ b/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php @@ -142,10 +142,16 @@ private function isVarTagUnionTypeMockObject(PhpDocInfo $phpDocInfo, Property $p if (! $varTagType instanceof UnionType) { return false; } +<<<<<<< HEAD return array_any( $varTagType->getTypes(), fn (Type $unionedType): bool => $unionedType->isSuperTypeOf(new ObjectType(ClassName::MOCK_OBJECT))->yes() +======= + return array_any( + $varTagType->getTypes(), + fn ($unionedType) => $unionedType->isSuperTypeOf(new ObjectType(ClassName::MOCK_OBJECT))->yes() +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php index a7a11b1a215..f6cf225d621 100644 --- a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php +++ b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php @@ -239,7 +239,11 @@ private function shouldSkipNode(ClassMethod|Function_|Closure|ArrowFunction $nod */ private function hasImplicitNullReturn(array $returnStatements): bool { +<<<<<<< HEAD return array_any($returnStatements, fn (Return_ $return): bool => ! $return->expr instanceof Expr); +======= + return array_any($returnStatements, fn ($returnStatement): bool => $returnStatement->expr === null); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** diff --git a/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php b/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php index 4ad533970b7..632452e0087 100644 --- a/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php +++ b/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php @@ -180,11 +180,15 @@ private function areSwitchStmtsEqualsAndWithBreak(Case_ $currentCase, Case_ $nex if (! $this->nodeComparator->areNodesEqual($currentCase->stmts, $nextCase->stmts)) { return false; } +<<<<<<< HEAD return array_any( $currentCase->stmts, fn (Stmt $stmt): bool => $stmt instanceof Break_ || $stmt instanceof Return_ ); +======= + return array_any($currentCase->stmts, fn ($stmt): bool => $stmt instanceof Break_ || $stmt instanceof Return_); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function areSwitchStmtsEqualsConsideringComments(Case_ $currentCase, Case_ $nextCase): bool diff --git a/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php b/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php index c1b2e331449..7978dcf364e 100644 --- a/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php +++ b/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php @@ -13,6 +13,10 @@ final class GenericTypeNodeAnalyzer public function hasGenericType(BracketsAwareUnionTypeNode $bracketsAwareUnionTypeNode): bool { $types = $bracketsAwareUnionTypeNode->types; +<<<<<<< HEAD return array_any($types, fn (TypeNode $typeNode): bool => $typeNode instanceof GenericTypeNode); +======= + return array_any($types, fn ($type): bool => $type instanceof GenericTypeNode); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php b/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php index fe1de1acf25..3b5e3bff2ef 100644 --- a/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php +++ b/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php @@ -175,7 +175,10 @@ private function doesNotLastStatementBreakFlow(If_ | ElseIf_ | Else_ $node): boo )) { return true; } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $lastStmt->elseifs, fn (If_|ElseIf_|Else_ $elseIf): bool => $this->doesNotLastStatementBreakFlow($elseIf) diff --git a/rules/Naming/VariableRenamer.php b/rules/Naming/VariableRenamer.php index 43c38939083..525c5f6acec 100644 --- a/rules/Naming/VariableRenamer.php +++ b/rules/Naming/VariableRenamer.php @@ -124,7 +124,10 @@ private function isParamInParentFunction(Variable $variable, ?FunctionLike $func )) { return false; } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $functionLike->getParams(), fn (Node|array $param): bool => $this->nodeNameResolver->isName($param, $variableName) diff --git a/rules/Php71/Rector/List_/ListToArrayDestructRector.php b/rules/Php71/Rector/List_/ListToArrayDestructRector.php index 4dbdae1ee32..4f2c0a6bf20 100644 --- a/rules/Php71/Rector/List_/ListToArrayDestructRector.php +++ b/rules/Php71/Rector/List_/ListToArrayDestructRector.php @@ -115,6 +115,10 @@ public function provideMinPhpVersion(): int private function hasPartialDestruct(List_ $list): bool { +<<<<<<< HEAD return array_any($list->items, fn (?ArrayItem $arrayItem): bool => ! $arrayItem instanceof ArrayItem); +======= + return array_any($list->items, fn ($listItem): bool => ! $listItem instanceof ArrayItem); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php b/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php index 1cf29e52be8..0f8a010a829 100644 --- a/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php +++ b/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php @@ -75,7 +75,10 @@ function (Node $node) use ($variables): bool { if (! $node instanceof FuncCall) { return false; } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $variables, fn (Variable $variable): bool => $this->compactFuncCallAnalyzer->isInCompact($node, $variable) diff --git a/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php b/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php index 563ff2afe82..bc9eecbd009 100644 --- a/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php +++ b/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php @@ -35,10 +35,14 @@ public function __construct( */ public function isReturnCondsAndExprs(array $condAndExprs): bool { +<<<<<<< HEAD return array_any( $condAndExprs, fn (CondAndExpr $condAndExpr): bool => $condAndExpr->equalsMatchKind(MatchKind::RETURN) ); +======= + return array_any($condAndExprs, fn ($condAndExpr) => $condAndExpr->equalsMatchKind(MatchKind::RETURN)); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -107,7 +111,11 @@ public function haveCondAndExprsMatchPotential(array $condAndExprs): bool */ public function hasCondsAndExprDefaultValue(array $condAndExprs): bool { +<<<<<<< HEAD return array_any($condAndExprs, fn (CondAndExpr $condAndExpr): bool => $condAndExpr->getCondExprs() === null); +======= + return array_any($condAndExprs, fn ($condAndExpr): bool => $condAndExpr->getCondExprs() === null); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function hasDefaultValue(Match_ $match): bool diff --git a/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php b/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php index 53d35c91325..ee9d0ad85c4 100644 --- a/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php +++ b/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php @@ -127,6 +127,10 @@ private function hasBreakOrReturnOrEmpty(Case_ $case): bool private function containsCaseReturn(Case_ $case): bool { +<<<<<<< HEAD return array_any($case->stmts, fn (Stmt $stmt): bool => $stmt instanceof Return_); +======= + return array_any($case->stmts, fn ($stmt): bool => $stmt instanceof Return_); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php b/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php index cd2038334ea..143caaa59f4 100644 --- a/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php +++ b/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php @@ -354,11 +354,15 @@ private function shouldSkipParam(Param $param): bool if (! $type instanceof UnionType) { return false; } +<<<<<<< HEAD return array_any( $type->types, fn (Identifier|IntersectionType|Name $type): bool => $this->isCallableTypeIdentifier($type) ); +======= + return array_any($type->types, fn (?Node $type): bool => $this->isCallableTypeIdentifier($type)); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function isCallableTypeIdentifier(?Node $node): bool diff --git a/rules/Php80/ValueObject/NestedAnnotationToAttribute.php b/rules/Php80/ValueObject/NestedAnnotationToAttribute.php index 7ab86e4112c..d981ac16748 100644 --- a/rules/Php80/ValueObject/NestedAnnotationToAttribute.php +++ b/rules/Php80/ValueObject/NestedAnnotationToAttribute.php @@ -64,7 +64,11 @@ public function hasExplicitParameters(): bool { return array_any( $this->annotationPropertiesToAttributeClasses, +<<<<<<< HEAD fn (AnnotationPropertyToAttributeClass $annotationPropertyToAttributeClass): bool => is_string( +======= + fn ($annotationPropertyToAttributeClass): bool => is_string( +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) $annotationPropertyToAttributeClass->getAnnotationProperty() ) ); diff --git a/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php b/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php index 1fa9153bcbe..18d9547ffb9 100644 --- a/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php +++ b/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php @@ -72,7 +72,11 @@ private function resolveParentClassReflections(Scope $scope): array */ private function hasNonTypedProperty(array $properties): bool { +<<<<<<< HEAD return array_any($properties, fn (Property $property): bool => ! $property->type instanceof Node); +======= + return array_any($properties, fn ($property): bool => $property->type === null); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function shouldSkip(Class_ $class, Scope $scope): bool @@ -155,10 +159,14 @@ private function shouldSkipConsumeTraitProperty(Class_ $class): bool */ private function hasReadonlyProperty(array $properties): bool { +<<<<<<< HEAD return array_any( $properties, fn (ReflectionProperty $reflectionProperty): bool => ! $reflectionProperty->isReadOnly() ); +======= + return array_any($properties, fn ($property): bool => ! $property->isReadOnly()); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -166,7 +174,11 @@ private function hasReadonlyProperty(array $properties): bool */ private function isExtendsReadonlyClass(array $parents): bool { +<<<<<<< HEAD return array_any($parents, fn (ClassReflection $classReflection): bool => $classReflection->isReadOnly()); +======= + return array_any($parents, fn ($parent) => $parent->isReadOnly()); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -174,7 +186,11 @@ private function isExtendsReadonlyClass(array $parents): bool */ private function hasWritableProperty(array $properties): bool { +<<<<<<< HEAD return array_any($properties, fn (Property $property): bool => ! $property->isReadonly()); +======= + return array_any($properties, fn ($property): bool => ! $property->isReadonly()); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function shouldSkipClass(Class_ $class): bool diff --git a/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php b/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php index c029df214fe..f586449c2c5 100644 --- a/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php +++ b/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php @@ -163,7 +163,11 @@ public function isConstGuardedByParents(Const_ $const, array $parentClassReflect $constantName = $this->getName($const); return array_any( $parentClassReflections, +<<<<<<< HEAD fn (ClassReflection $parentClassReflection): bool => $parentClassReflection->hasConstant($constantName) +======= + fn ($parentClassReflection) => $parentClassReflection->hasConstant($constantName) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php b/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php index 786244d45c5..d45491c3ded 100644 --- a/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php +++ b/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php @@ -110,7 +110,11 @@ private function shouldSkipNamedArg(FuncCall|MethodCall $node): bool { return array_any( $node->getArgs(), +<<<<<<< HEAD fn (Arg $arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === 'escape' +======= + fn ($arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === 'escape' +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/Privatization/Guard/OverrideByParentClassGuard.php b/rules/Privatization/Guard/OverrideByParentClassGuard.php index 8bb42b00f3e..8ac29a4c7f2 100644 --- a/rules/Privatization/Guard/OverrideByParentClassGuard.php +++ b/rules/Privatization/Guard/OverrideByParentClassGuard.php @@ -26,10 +26,16 @@ public function isLegal(Class_ $class): bool )) { return false; } +<<<<<<< HEAD return array_all( $class->implements, fn (Name $name): bool => $this->reflectionProvider->hasClass($name->toString()) +======= + return array_all( + $class->implements, + fn ($implement): bool => $this->reflectionProvider->hasClass($implement->toString()) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php b/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php index b699e7e9bbd..b124f6ec98d 100644 --- a/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php +++ b/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php @@ -42,7 +42,11 @@ public function isClassMethodVisibilityGuardedByTrait( $methodName = $this->nodeNameResolver->getName($classMethod); return array_any( $parentTraitReflections, +<<<<<<< HEAD fn (ClassReflection $classReflection): bool => $classReflection->hasMethod($methodName) +======= + fn ($parentTraitReflection) => $parentTraitReflection->hasMethod($methodName) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php b/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php index e81297e81d5..0b5a166e46b 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php @@ -170,10 +170,16 @@ private function isNativeBooleanReturnTypeFuncCall(FuncCall $funcCall): bool if (! $functionReflection->isBuiltin()) { return false; } +<<<<<<< HEAD return array_all( $functionReflection->getVariants(), fn (ExtendedParametersAcceptor $extendedParametersAcceptor): bool => $extendedParametersAcceptor->getNativeReturnType() +======= + return array_all( + $functionReflection->getVariants(), + fn ($extendedParametersAcceptor) => $extendedParametersAcceptor->getNativeReturnType() +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ->isBoolean() ->yes() ); diff --git a/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php b/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php index aa8da3d326a..f31cf14e906 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php @@ -236,6 +236,10 @@ private function refactorFunctionLike( private function hasAtLeastOneParamWithoutType(ClassMethod|Function_|Closure|ArrowFunction $functionLike): bool { +<<<<<<< HEAD return array_any($functionLike->params, fn (Param $param): bool => ! $param->type instanceof Node); +======= + return array_any($functionLike->params, fn ($param): bool => ! $param->type instanceof Node); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php index 27f12028eee..36e01413682 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php @@ -199,10 +199,16 @@ private function isEchoed(Node $node, string $paramName): bool if (! $node instanceof Echo_) { return false; } +<<<<<<< HEAD return array_any( $node->exprs, fn (Expr $expr): bool => $expr instanceof Variable && $this->isName($expr, $paramName) +======= + return array_any( + $node->exprs, + fn ($expr): bool => $expr instanceof Variable && $this->isName($expr, $paramName) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -264,10 +270,16 @@ private function isReassignAndUseAsArg(Node $node, string $paramName): bool if ($node->expr->isFirstClassCallable()) { return false; } +<<<<<<< HEAD return array_any( $node->expr->getArgs(), fn (Arg $arg): bool => $arg->value instanceof Variable && $this->isName($arg->value, $paramName) +======= + return array_any( + $node->expr->getArgs(), + fn ($arg): bool => $arg->value instanceof Variable && $this->isName($arg->value, $paramName) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php index 18439a43a02..7b0ac4dfefb 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php @@ -134,7 +134,11 @@ private function hasAlwaysStringScalarReturn(array $returns): bool { return array_all( $returns, +<<<<<<< HEAD fn (Return_ $return): bool => ! (! $return->expr instanceof String_ && ! $return->expr instanceof InterpolatedString) +======= + fn ($return): bool => ! (! $return->expr instanceof String_ && ! $return->expr instanceof InterpolatedString) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php b/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php index f014d56a3ae..49f6dd656ea 100644 --- a/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php +++ b/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php @@ -257,9 +257,13 @@ private function methodSignatureUsesCallableWithIteratorTypes(string $className, */ private function callUsesClosures(array $args): bool { +<<<<<<< HEAD return array_any( $args, fn (Arg|VariadicPlaceholder $arg): bool => $arg instanceof Arg && $arg->value instanceof Closure ); +======= + return array_any($args, fn ($arg): bool => $arg instanceof Arg && $arg->value instanceof Closure); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php b/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php index 72d8f123bda..b243d9bb9b9 100644 --- a/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php +++ b/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php @@ -12,6 +12,10 @@ { public function isAllGenericClassStringType(UnionType $unionType): bool { +<<<<<<< HEAD return array_all($unionType->getTypes(), fn (Type $type): bool => $type instanceof GenericClassStringType); +======= + return array_all($unionType->getTypes(), fn ($type): bool => $type instanceof GenericClassStringType); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php b/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php index d2cbf4d2cd5..5c0044e42f9 100644 --- a/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php +++ b/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php @@ -208,7 +208,11 @@ private function isConstantArrayType(Type $returnedExprType): bool if ($returnedExprType instanceof UnionType) { return array_all( $returnedExprType->getTypes(), +<<<<<<< HEAD fn (Type $unionedType): bool => $unionedType instanceof ConstantArrayType +======= + fn ($unionedType): bool => $unionedType instanceof ConstantArrayType +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/scripts/no-php-file-in-fixtures.php b/scripts/no-php-file-in-fixtures.php index d363b557ff7..80d956a425d 100644 --- a/scripts/no-php-file-in-fixtures.php +++ b/scripts/no-php-file-in-fixtures.php @@ -72,7 +72,7 @@ private function findPhpFiles(array $directories): array { Assert::allDirectory($directories); - $finder = (new Finder()) + $finder = new Finder() ->files() ->in($directories) ->path('/Fixture') @@ -92,7 +92,7 @@ private function findFixtureFiles(array $directories): array { Assert::allDirectory($directories); - $finder = (new Finder()) + $finder = new Finder() ->files() ->in($directories) ->path('Fixture') diff --git a/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php b/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php index a89a42de16b..285842c9805 100644 --- a/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php +++ b/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php @@ -21,6 +21,10 @@ public function isLegal(Type $type): bool private function isLegalUnionType(UnionType $type): bool { +<<<<<<< HEAD return array_all($type->getTypes(), fn (Type $unionType): bool => ! $unionType instanceof MixedType); +======= + return array_all($type->getTypes(), fn ($unionType): bool => ! $unionType instanceof MixedType); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php b/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php index e556cf17118..b2ca945d2c1 100644 --- a/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php +++ b/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php @@ -189,7 +189,11 @@ private function hasDocblockStart(string $output): bool { return array_any( self::DOCBLOCK_STARTS, +<<<<<<< HEAD fn (string $docblockStart): bool => str_starts_with($output, $docblockStart) +======= + fn ($docblockStart): bool => str_starts_with($output, (string) $docblockStart) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php b/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php index 54d37f3ea2c..c7cd563c66f 100644 --- a/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php +++ b/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php @@ -95,7 +95,11 @@ public function partialTokens(int $start, int $end): array public function containsTokenType(int $type): bool { +<<<<<<< HEAD return array_any($this->getTokens(), fn (array $token): bool => $token[1] === $type); +======= + return array_any($this->getTokens(), fn ($token): bool => $token[1] === $type); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function nextTokenType(): ?int diff --git a/src/Bootstrap/AutoloadFileParameterResolver.php b/src/Bootstrap/AutoloadFileParameterResolver.php index 7aa2462e7c4..b760f4a9c44 100644 --- a/src/Bootstrap/AutoloadFileParameterResolver.php +++ b/src/Bootstrap/AutoloadFileParameterResolver.php @@ -27,7 +27,8 @@ public static function resolveFromArgv(array $argv): void // handles "--autoload-file path", "--autoload-file=path" and "-a path"; // parallel workers receive the space-separated form, so all spellings must // normalize to the same value or main process and workers would disagree - $autoloadFile = (new ArgvInput($argv))->getParameterOption(['--autoload-file', '-a'], null); + $autoloadFile = new ArgvInput($argv) + ->getParameterOption(['--autoload-file', '-a'], null); if (! is_string($autoloadFile) || $autoloadFile === '') { return; } diff --git a/src/Configuration/RectorConfigBuilder.php b/src/Configuration/RectorConfigBuilder.php index 0fadacd0134..72fe8c644fb 100644 --- a/src/Configuration/RectorConfigBuilder.php +++ b/src/Configuration/RectorConfigBuilder.php @@ -438,7 +438,8 @@ public function withSkipPath(string $skipPath): self */ public function withRootFiles(): self { - $rootPhpFilesFinder = (new Finder())->files() + $rootPhpFilesFinder = new Finder() + ->files() ->in(getcwd()) ->depth(0) ->ignoreDotFiles(false) diff --git a/src/Configuration/VendorMissAnalyseGuard.php b/src/Configuration/VendorMissAnalyseGuard.php index 172781fcf95..56b65e74351 100644 --- a/src/Configuration/VendorMissAnalyseGuard.php +++ b/src/Configuration/VendorMissAnalyseGuard.php @@ -25,10 +25,16 @@ private function hasDowngradeSets(): bool { /** @var string[] $registeredRectorSets */ $registeredRectorSets = SimpleParameterProvider::provideArrayParameter(Option::REGISTERED_RECTOR_SETS); +<<<<<<< HEAD return array_any( $registeredRectorSets, fn (string $registeredRectorSet): bool => str_contains($registeredRectorSet, 'downgrade-') +======= + return array_any( + $registeredRectorSets, + fn ($registeredRectorSet): bool => str_contains((string) $registeredRectorSet, 'downgrade-') +>>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) ); } diff --git a/src/CustomRules/SimpleNodeDumper.php b/src/CustomRules/SimpleNodeDumper.php index 5bee4c4bf3c..d3d54ddbd15 100644 --- a/src/CustomRules/SimpleNodeDumper.php +++ b/src/CustomRules/SimpleNodeDumper.php @@ -81,7 +81,11 @@ public static function dump(array|Node $node, bool $rootNode = true): string */ private static function isStringList(array $items): bool { +<<<<<<< HEAD return array_all($items, fn (mixed $item): bool => is_string($item)); +======= + return array_all($items, fn ($item): bool => is_string($item)); +>>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) } private static function dumpFlags(mixed $flags): string diff --git a/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php b/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php index cfd91937ce9..d48e70c5919 100644 --- a/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php +++ b/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php @@ -26,11 +26,18 @@ public function hasAbstractParentClassMethod(ClassReflection $classReflection, s if ($parentClassMethods === []) { return false; } +<<<<<<< HEAD +<<<<<<< HEAD return array_any( $parentClassMethods, fn (PhpMethodReflection $phpMethodReflection): bool => $phpMethodReflection->isAbstract() ); +======= +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) + return array_any($parentClassMethods, fn ($parentClassMethod) => $parentClassMethod->isAbstract()); +>>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) } /** diff --git a/src/NodeAnalyzer/ArgsAnalyzer.php b/src/NodeAnalyzer/ArgsAnalyzer.php index d8dfafab50a..8a086d508bf 100644 --- a/src/NodeAnalyzer/ArgsAnalyzer.php +++ b/src/NodeAnalyzer/ArgsAnalyzer.php @@ -20,7 +20,11 @@ public function __construct( */ public function hasNamedArg(array $args): bool { +<<<<<<< HEAD return array_any($args, fn (Arg $arg): bool => $arg->name instanceof Identifier); +======= + return array_any($args, fn ($arg): bool => $arg->name instanceof Identifier); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** diff --git a/src/NodeAnalyzer/CallAnalyzer.php b/src/NodeAnalyzer/CallAnalyzer.php index 4c89e952fab..6527ca3997f 100644 --- a/src/NodeAnalyzer/CallAnalyzer.php +++ b/src/NodeAnalyzer/CallAnalyzer.php @@ -41,11 +41,15 @@ public function isObjectCall(Expr $expr): bool return $isObjectCallLeft || $isObjectCallRight; } +<<<<<<< HEAD return array_any( self::OBJECT_CALL_TYPES, fn (string $objectCallType): bool => $expr instanceof $objectCallType ); +======= + return array_any(self::OBJECT_CALL_TYPES, fn ($objectCallType): bool => $expr instanceof $objectCallType); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -53,7 +57,11 @@ public function isObjectCall(Expr $expr): bool */ public function doesIfHasObjectCall(array $ifs): bool { +<<<<<<< HEAD return array_any($ifs, fn (If_ $if): bool => $this->isObjectCall($if->cond)); +======= + return array_any($ifs, fn ($if): bool => $this->isObjectCall($if->cond)); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function isNewInstance(Variable $variable): bool diff --git a/src/NodeAnalyzer/CallLikeArgumentNameAdder.php b/src/NodeAnalyzer/CallLikeArgumentNameAdder.php index 25e2a2a9118..dda31e71409 100644 --- a/src/NodeAnalyzer/CallLikeArgumentNameAdder.php +++ b/src/NodeAnalyzer/CallLikeArgumentNameAdder.php @@ -84,7 +84,10 @@ private function shouldSkip(CallLike $callLike): bool if ($args === []) { return true; } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any($args, fn ($arg) => $arg->unpack); } diff --git a/src/NodeAnalyzer/DoctrineEntityAnalyzer.php b/src/NodeAnalyzer/DoctrineEntityAnalyzer.php index e9dce6221a8..e3053137fef 100644 --- a/src/NodeAnalyzer/DoctrineEntityAnalyzer.php +++ b/src/NodeAnalyzer/DoctrineEntityAnalyzer.php @@ -49,10 +49,16 @@ public function hasClassReflectionAttribute(ClassReflection $classReflection): b if ($nativeReflectionClass->getAttributes() === []) { return false; } +<<<<<<< HEAD return array_any( self::DOCTRINE_MAPPING_CLASSES, fn (string $doctrineMappingClass): bool => $nativeReflectionClass->getAttributes( +======= + return array_any( + self::DOCTRINE_MAPPING_CLASSES, + fn (?string $doctrineMappingClass): bool => $nativeReflectionClass->getAttributes( +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) $doctrineMappingClass ) !== [] ); diff --git a/src/NodeAnalyzer/ParamAnalyzer.php b/src/NodeAnalyzer/ParamAnalyzer.php index b216d0b1f7c..52108321aa9 100644 --- a/src/NodeAnalyzer/ParamAnalyzer.php +++ b/src/NodeAnalyzer/ParamAnalyzer.php @@ -103,7 +103,11 @@ public function isParamUsedInClassMethod(ClassMethod $classMethod, Param $param) */ public function hasPropertyPromotion(array $params): bool { +<<<<<<< HEAD return array_any($params, fn (Param $param): bool => $param->isPromoted()); +======= + return array_any($params, fn ($param) => $param->isPromoted()); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function isNullable(Param $param): bool @@ -139,10 +143,14 @@ public function isParamReassign(ClassMethod $classMethod, Param $param): bool private function isVariableInClosureUses(Closure $closure, Variable $variable): bool { +<<<<<<< HEAD return array_any( $closure->uses, fn (ClosureUse $use): bool => $this->nodeComparator->areNodesEqual($use->var, $variable) ); +======= + return array_any($closure->uses, fn ($use): bool => $this->nodeComparator->areNodesEqual($use->var, $variable)); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function isUsedAsArg(Node $node, Param $param): bool diff --git a/src/NodeAnalyzer/ScopeAnalyzer.php b/src/NodeAnalyzer/ScopeAnalyzer.php index 1734898b92e..537b887289a 100644 --- a/src/NodeAnalyzer/ScopeAnalyzer.php +++ b/src/NodeAnalyzer/ScopeAnalyzer.php @@ -18,9 +18,13 @@ final class ScopeAnalyzer public function isRefreshable(Node $node): bool { +<<<<<<< HEAD return array_all( self::NON_REFRESHABLE_NODES, fn (string $noScopeNode): bool => ! $node instanceof $noScopeNode ); +======= + return array_all(self::NON_REFRESHABLE_NODES, fn ($noScopeNode): bool => ! $node instanceof $noScopeNode); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/src/NodeAnalyzer/VariadicAnalyzer.php b/src/NodeAnalyzer/VariadicAnalyzer.php index 6c0b1b382ff..8cd2a4400a4 100644 --- a/src/NodeAnalyzer/VariadicAnalyzer.php +++ b/src/NodeAnalyzer/VariadicAnalyzer.php @@ -34,7 +34,11 @@ private function hasVariadicVariant(MethodReflection | FunctionReflection $funct { return array_any( $functionLikeReflection->getVariants(), +<<<<<<< HEAD fn (ParametersAcceptor $parametersAcceptor): bool => $parametersAcceptor->isVariadic() +======= + fn ($parametersAcceptor) => $parametersAcceptor->isVariadic() +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/src/NodeManipulator/ClassDependencyManipulator.php b/src/NodeManipulator/ClassDependencyManipulator.php index 565ab0099a1..532c68e5384 100644 --- a/src/NodeManipulator/ClassDependencyManipulator.php +++ b/src/NodeManipulator/ClassDependencyManipulator.php @@ -334,10 +334,16 @@ private function hasClassParentClassMethod(Class_ $class, string $methodName): b if (! $classReflection instanceof ClassReflection) { return false; } +<<<<<<< HEAD return array_any( $classReflection->getParents(), fn (ClassReflection $parentClassReflection): bool => $parentClassReflection->hasMethod($methodName) +======= + return array_any( + $classReflection->getParents(), + fn ($parentClassReflection) => $parentClassReflection->hasMethod($methodName) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -354,7 +360,10 @@ private function isParamInConstructor(Class_ $class, string $propertyName): bool if (! $constructClassMethod instanceof ClassMethod) { return false; } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $constructClassMethod->params, fn (Node|array $param): bool => $this->nodeNameResolver->isName($param, $propertyName) diff --git a/src/NodeManipulator/ClassMethodManipulator.php b/src/NodeManipulator/ClassMethodManipulator.php index 2d23690f4c6..a76618eb7fb 100644 --- a/src/NodeManipulator/ClassMethodManipulator.php +++ b/src/NodeManipulator/ClassMethodManipulator.php @@ -57,10 +57,16 @@ public function hasParentMethodOrInterfaceMethod(Class_ $class, string $methodNa return true; } } +<<<<<<< HEAD return array_any( $classReflection->getInterfaces(), fn (ClassReflection $classReflection): bool => $classReflection->hasMethod($methodName) +======= + return array_any( + $classReflection->getInterfaces(), + fn ($interfaceReflection) => $interfaceReflection->hasMethod($methodName) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/src/NodeNameResolver/NodeNameResolver.php b/src/NodeNameResolver/NodeNameResolver.php index 620ea64ecbd..a8f6f301265 100644 --- a/src/NodeNameResolver/NodeNameResolver.php +++ b/src/NodeNameResolver/NodeNameResolver.php @@ -60,7 +60,10 @@ public function isNames(Node $node, array $names): bool if ($nodeName === null) { return false; } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any($names, fn (string $name): bool => $this->isStringName($nodeName, $name)); } diff --git a/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php b/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php index 40d773291e6..96e2fb5fac5 100644 --- a/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php +++ b/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php @@ -54,7 +54,10 @@ private function isAlwaysTruableUnionType(Type $type): bool if (! $type instanceof UnionType) { return false; } +<<<<<<< HEAD +======= +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_all($type->getTypes(), fn (Type $unionedType): bool => $this->isAlwaysTruableType($unionedType)); } diff --git a/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php b/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php index e281cd14df3..3bda8748c24 100644 --- a/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php +++ b/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php @@ -91,8 +91,12 @@ private function containsInteger(Type $type): bool if (! $type instanceof UnionType) { return false; } +<<<<<<< HEAD return array_any($type->getTypes(), fn (Type $unionedType): bool => $unionedType->isInteger()->yes()); +======= + return array_any($type->getTypes(), fn ($unionedType) => $unionedType->isInteger()->yes()); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** diff --git a/src/PhpParser/Enum/NodeGroup.php b/src/PhpParser/Enum/NodeGroup.php index 43e3826488d..e6f034690bf 100644 --- a/src/PhpParser/Enum/NodeGroup.php +++ b/src/PhpParser/Enum/NodeGroup.php @@ -82,6 +82,10 @@ final class NodeGroup public static function isStmtAwareNode(Node $node): bool { +<<<<<<< HEAD return array_any(self::STMTS_AWARE, fn (string $stmtAwareClass): bool => $node instanceof $stmtAwareClass); +======= + return array_any(self::STMTS_AWARE, fn ($stmtAwareClass): bool => $node instanceof $stmtAwareClass); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/src/PhpParser/Node/BetterNodeFinder.php b/src/PhpParser/Node/BetterNodeFinder.php index 5743cbf390c..7a626dc252f 100644 --- a/src/PhpParser/Node/BetterNodeFinder.php +++ b/src/PhpParser/Node/BetterNodeFinder.php @@ -113,7 +113,11 @@ public function hasInstancesOf(Node | array $nodes, array $types): bool return (bool) $this->nodeFinder->findFirst( $nodes, +<<<<<<< HEAD static fn (Node $node): bool => array_any($types, fn (string $type): bool => $node instanceof $type) +======= + static fn (Node $node): bool => array_any($types, fn ($type): bool => $node instanceof $type) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/src/PhpParser/Node/FileNode.php b/src/PhpParser/Node/FileNode.php index c39b2d0c27b..fa6295647d3 100644 --- a/src/PhpParser/Node/FileNode.php +++ b/src/PhpParser/Node/FileNode.php @@ -142,9 +142,13 @@ public function hasImport(FullyQualifiedObjectType $fullyQualifiedObjectType): b { return array_any( $this->resolveUsedImportTypes(), +<<<<<<< HEAD fn (AliasedObjectType|FullyQualifiedObjectType $useImport): bool => $useImport->equals( $fullyQualifiedObjectType ) +======= + fn ($useImport) => $useImport->equals($fullyQualifiedObjectType) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -223,7 +227,11 @@ public function getSubNodeNames(): array public function isNamespaced(): bool { +<<<<<<< HEAD return array_any($this->stmts, fn (Stmt $stmt): bool => $stmt instanceof Namespace_); +======= + return array_any($this->stmts, fn ($stmt): bool => $stmt instanceof Namespace_); +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function getNamespace(): ?Namespace_ diff --git a/src/PhpParser/Node/Value/ValueResolver.php b/src/PhpParser/Node/Value/ValueResolver.php index 77a9b830dec..2b90631533c 100644 --- a/src/PhpParser/Node/Value/ValueResolver.php +++ b/src/PhpParser/Node/Value/ValueResolver.php @@ -117,7 +117,11 @@ public function getValue(Arg|Expr|InterpolatedStringPart $expr, bool $resolvedCl */ public function isValues(Expr $expr, array $expectedValues): bool { +<<<<<<< HEAD return array_any($expectedValues, fn (mixed $expectedValue): bool => $this->isValue($expr, $expectedValue)); +======= + return array_any($expectedValues, fn ($expectedValue): bool => $this->isValue($expr, $expectedValue)); +>>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) } public function isFalse(Expr $expr): bool diff --git a/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php b/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php index 3dd34c32bd8..9f25b7a1086 100644 --- a/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php +++ b/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php @@ -48,7 +48,11 @@ private function hasParentInterfaceMethod(ClassReflection $classReflection, stri { return array_any( $classReflection->getInterfaces(), +<<<<<<< HEAD fn (ClassReflection $interfaceClassReflection): bool => $interfaceClassReflection->hasMethod($methodName) +======= + fn ($interfaceClassReflection) => $interfaceClassReflection->hasMethod($methodName) +>>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } From cfacd621bf5bcf6d3e8697aa25f12aa5e29db3be Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Fri, 19 Jun 2026 13:09:05 +0200 Subject: [PATCH 3/4] [ci] bump GitHub Actions PHP version to 8.4 --- .github/workflows/build_scoped_rector.yaml | 2 +- .github/workflows/claude_issue_fixer.yaml | 2 +- .github/workflows/code_analysis.yaml | 2 +- .github/workflows/code_analysis_no_dev.yaml | 2 +- .github/workflows/e2e.yaml | 2 +- .github/workflows/e2e_command_with_option.yaml | 2 +- .github/workflows/e2e_with_cache.yaml | 4 ++-- .github/workflows/e2e_with_no_diffs.yaml | 2 +- .github/workflows/packages_tests.yaml | 2 +- .github/workflows/phpstan_printer_test.yaml | 2 +- ...phpunit_and_phpstan_autoload_compat_test.yaml | 6 +++--- .github/workflows/rector.yaml | 4 ++-- .github/workflows/rector_drupal_rector_dev.yaml | 2 +- .github/workflows/rector_laravel_rector_dev.yaml | 2 +- .github/workflows/remove_unused_deps.yaml | 2 +- .github/workflows/tests.yaml | 2 +- .github/workflows/weekly_pull_requests.yaml | 2 +- phpstan.neon | 14 ++------------ .../Catch_/ThrowWithPreviousExceptionRector.php | 8 -------- .../ChangeArrayPushToArrayAssignRector.php | 4 ---- .../ValueObject/PendingImports.php | 9 --------- ...FunctionAndClosureFirstClassCallableGuard.php | 8 -------- .../NodeAnalyzer/NoDiscardCallAnalyzer.php | 4 ---- .../PhpDoc/Guard/TemplateTypeRemovalGuard.php | 4 ---- .../RemoveUnusedPrivateClassConstantRector.php | 4 ---- .../RemoveTypedPropertyNonMockDocblockRector.php | 6 ------ .../NarrowWideUnionReturnTypeRector.php | 4 ---- .../RemoveTypedPropertyDeadInstanceOfRector.php | 3 ++- .../RemoveDuplicatedCaseInSwitchRector.php | 4 ---- .../TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php | 4 ---- .../Rector/If_/RemoveAlwaysElseRector.php | 3 --- rules/Naming/VariableRenamer.php | 3 --- .../Rector/List_/ListToArrayDestructRector.php | 4 ---- .../ClosureArrowFunctionAnalyzer.php | 3 --- rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php | 8 -------- rules/Php80/NodeAnalyzer/SwitchAnalyzer.php | 4 ---- ...ropertyAssignToConstructorPromotionRector.php | 4 ---- .../ValueObject/NestedAnnotationToAttribute.php | 4 ---- .../NodeManipulator/ReadonlyClassManipulator.php | 16 ---------------- .../Rector/ClassConst/AddTypeToConstRector.php | 4 ---- .../Rector/FuncCall/AddEscapeArgumentRector.php | 4 ---- .../Guard/OverrideByParentClassGuard.php | 6 ------ .../ClassMethodVisibilityGuard.php | 4 ---- ...lReturnTypeFromBooleanStrictReturnsRector.php | 6 ------ .../ParamTypeByMethodCallTypeRector.php | 4 ---- .../StrictArrayParamDimFetchRector.php | 12 ------------ ...ngReturnTypeFromStrictStringReturnsRector.php | 4 ---- ...sureParamTypeFromIterableMethodCallRector.php | 4 ---- .../GenericClassStringTypeNormalizer.php | 4 ---- ...DocblockForDimFetchArrayFromAssignsRector.php | 4 ---- .../Guard/NewPhpDocFromPHPStanTypeGuard.php | 4 ---- .../Printer/PhpDocInfoPrinter.php | 4 ---- .../ValueObject/Parser/BetterTokenIterator.php | 4 ---- src/Configuration/VendorMissAnalyseGuard.php | 6 ------ src/CustomRules/SimpleNodeDumper.php | 4 ---- .../NodeAnalyzer/ClassChildAnalyzer.php | 7 ------- src/NodeAnalyzer/ArgsAnalyzer.php | 4 ---- src/NodeAnalyzer/CallAnalyzer.php | 8 -------- src/NodeAnalyzer/CallLikeArgumentNameAdder.php | 3 --- src/NodeAnalyzer/DoctrineEntityAnalyzer.php | 6 ------ src/NodeAnalyzer/ParamAnalyzer.php | 8 -------- src/NodeAnalyzer/ScopeAnalyzer.php | 4 ---- src/NodeAnalyzer/VariadicAnalyzer.php | 4 ---- .../ClassDependencyManipulator.php | 9 --------- src/NodeManipulator/ClassMethodManipulator.php | 6 ------ src/NodeNameResolver/NodeNameResolver.php | 3 --- .../PHPStan/Type/StaticTypeAnalyzer.php | 3 --- .../AnnotationToAttributeIntegerValueCaster.php | 4 ---- src/PhpParser/Comparing/NodeComparator.php | 2 +- src/PhpParser/Enum/NodeGroup.php | 4 ---- src/PhpParser/Node/BetterNodeFinder.php | 4 ---- src/PhpParser/Node/FileNode.php | 8 -------- src/PhpParser/Node/Value/ValueResolver.php | 4 ---- .../ClassMethodParamVendorLockResolver.php | 4 ---- 74 files changed, 26 insertions(+), 314 deletions(-) diff --git a/.github/workflows/build_scoped_rector.yaml b/.github/workflows/build_scoped_rector.yaml index 80d1624af84..30b96573a43 100644 --- a/.github/workflows/build_scoped_rector.yaml +++ b/.github/workflows/build_scoped_rector.yaml @@ -38,7 +38,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none # fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth diff --git a/.github/workflows/claude_issue_fixer.yaml b/.github/workflows/claude_issue_fixer.yaml index 6212c6e7e7b..7c4d42d759b 100644 --- a/.github/workflows/claude_issue_fixer.yaml +++ b/.github/workflows/claude_issue_fixer.yaml @@ -30,7 +30,7 @@ jobs: - name: Set up PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' tools: composer:v2 coverage: none diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 1670042a6bc..cc7683329cc 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -92,7 +92,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - uses: "ramsey/composer-install@v4" diff --git a/.github/workflows/code_analysis_no_dev.yaml b/.github/workflows/code_analysis_no_dev.yaml index 19bb5787803..532a6136ebb 100644 --- a/.github/workflows/code_analysis_no_dev.yaml +++ b/.github/workflows/code_analysis_no_dev.yaml @@ -17,7 +17,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - run: | diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index be970e32f7d..4456fd36529 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - php_version: ['8.3'] + php_version: ['8.4'] directory: - 'e2e/applied-auto-import' - 'e2e/applied-polyfill-php80' diff --git a/.github/workflows/e2e_command_with_option.yaml b/.github/workflows/e2e_command_with_option.yaml index e0edf1fcb7c..349f4281fba 100644 --- a/.github/workflows/e2e_command_with_option.yaml +++ b/.github/workflows/e2e_command_with_option.yaml @@ -27,7 +27,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - uses: "ramsey/composer-install@v4" diff --git a/.github/workflows/e2e_with_cache.yaml b/.github/workflows/e2e_with_cache.yaml index 97b6062b6a4..6c6f9daa675 100644 --- a/.github/workflows/e2e_with_cache.yaml +++ b/.github/workflows/e2e_with_cache.yaml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - php_version: ['8.3'] + php_version: ['8.4'] directory: - 'e2e/applied-rule-removed-node-with-cache' - 'e2e/timeout-file-not-cached' @@ -64,7 +64,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: '8.3' + php-version: '8.4' coverage: none - run: composer install --ansi diff --git a/.github/workflows/e2e_with_no_diffs.yaml b/.github/workflows/e2e_with_no_diffs.yaml index d44364b203c..e3af82a4d91 100644 --- a/.github/workflows/e2e_with_no_diffs.yaml +++ b/.github/workflows/e2e_with_no_diffs.yaml @@ -22,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - php_version: ['8.3'] + php_version: ['8.4'] directory: - 'e2e/applied-rule-removed-node-no-diffs' - 'e2e/applied-no-diffs-format-json' diff --git a/.github/workflows/packages_tests.yaml b/.github/workflows/packages_tests.yaml index ea071e6befe..0f910c4c15e 100644 --- a/.github/workflows/packages_tests.yaml +++ b/.github/workflows/packages_tests.yaml @@ -45,7 +45,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - run: composer config minimum-stability dev diff --git a/.github/workflows/phpstan_printer_test.yaml b/.github/workflows/phpstan_printer_test.yaml index 49e5e16d8fb..e40208db989 100644 --- a/.github/workflows/phpstan_printer_test.yaml +++ b/.github/workflows/phpstan_printer_test.yaml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - php-versions: ['8.3'] + php-versions: ['8.4'] runs-on: ${{ matrix.os }} timeout-minutes: 3 diff --git a/.github/workflows/phpunit_and_phpstan_autoload_compat_test.yaml b/.github/workflows/phpunit_and_phpstan_autoload_compat_test.yaml index 85f737b3bfc..b5effabcc0e 100644 --- a/.github/workflows/phpunit_and_phpstan_autoload_compat_test.yaml +++ b/.github/workflows/phpunit_and_phpstan_autoload_compat_test.yaml @@ -19,15 +19,15 @@ jobs: - name: 'Rector dev + PHPUnit 10' run: composer require "phpunit/phpunit:10.*" -W - php: 8.2 + php: 8.4 - name: 'Rector dev + PHPUnit 11' run: composer require "phpunit/phpunit:11.*" -W - php: 8.2 + php: 8.4 - name: 'Rector dev + PHPUnit 12' run: composer require "phpunit/phpunit:12.*" -W - php: 8.3 + php: 8.4 name: ${{ matrix.actions.name }} diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml index 743cb3ebc33..8cfd1220882 100644 --- a/.github/workflows/rector.yaml +++ b/.github/workflows/rector.yaml @@ -24,8 +24,8 @@ jobs: - uses: shivammathur/setup-php@v2 with: - # PHP 8.3 is required, so Rector's code is PHP 8.3 compatible even after refactoring - php-version: 8.3 + # PHP 8.4 is required, so Rector's code is PHP 8.4 compatible even after refactoring + php-version: 8.4 coverage: none - run: composer install --no-progress --ansi diff --git a/.github/workflows/rector_drupal_rector_dev.yaml b/.github/workflows/rector_drupal_rector_dev.yaml index 2be25002392..39b24b9354b 100644 --- a/.github/workflows/rector_drupal_rector_dev.yaml +++ b/.github/workflows/rector_drupal_rector_dev.yaml @@ -18,7 +18,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none # fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth diff --git a/.github/workflows/rector_laravel_rector_dev.yaml b/.github/workflows/rector_laravel_rector_dev.yaml index ad80c419076..9d0304c5ced 100644 --- a/.github/workflows/rector_laravel_rector_dev.yaml +++ b/.github/workflows/rector_laravel_rector_dev.yaml @@ -18,7 +18,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none # fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth diff --git a/.github/workflows/remove_unused_deps.yaml b/.github/workflows/remove_unused_deps.yaml index b5e50383456..0578eeeefe3 100644 --- a/.github/workflows/remove_unused_deps.yaml +++ b/.github/workflows/remove_unused_deps.yaml @@ -22,7 +22,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - run: composer install --no-progress --ansi diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0b189cfa00b..5335d442d7c 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - php-versions: ['8.3', '8.4', '8.5'] + php-versions: ['8.4', '8.5'] runs-on: ${{ matrix.os }} timeout-minutes: 4 diff --git a/.github/workflows/weekly_pull_requests.yaml b/.github/workflows/weekly_pull_requests.yaml index 01f59d89fb2..2f9bdadd3b0 100644 --- a/.github/workflows/weekly_pull_requests.yaml +++ b/.github/workflows/weekly_pull_requests.yaml @@ -41,7 +41,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - uses: "ramsey/composer-install@v4" diff --git a/phpstan.neon b/phpstan.neon index 38c48149cd5..efd9a79a4cc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -355,10 +355,6 @@ parameters: identifier: symplify.noConstructorOverride path: src/StaticTypeMapper/ValueObject/Type/SimpleStaticType.php -# - -# identifier: arrayValues.list -# path: rules/CodingStyle/Application/UseImportsAdder.php - - message: '#Offset float\|int\|string might not exist on string#' path: rules/Php70/EregToPcreTransformer.php @@ -457,17 +453,11 @@ parameters: - '#Provide more specific return type "Iterator|PhpParser\\Node" over abstract one#' - # false positive - - -<<<<<<< HEAD - message: '#Access to deprecated property \$file of class Rector\\Rector\\AbstractRector#' - path: src/Rector/AbstractRector.php - # allowed - message: '#"@\\simplexml_load_string\(\$junitXml\)" is forbidden to use#' path: scripts/remove-unused-deps.php -======= + + - path: src/Util/Reflection/PrivatesAccessor.php identifier: symplify.newOverSetters ->>>>>>> 16ebfd1c27 (bump deps to PHP 8.4) diff --git a/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php b/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php index e571ac4a19e..0ce0dad3fd3 100644 --- a/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php +++ b/rules/CodeQuality/Rector/Catch_/ThrowWithPreviousExceptionRector.php @@ -236,11 +236,7 @@ private function hasParameter(New_ $new, string $parameterName): bool ); return array_any( $extendedParametersAcceptor->getParameters(), -<<<<<<< HEAD fn (ExtendedParameterReflection $extendedParameterReflection): bool => $extendedParameterReflection->getName() === $parameterName -======= - fn ($extendedParameterReflection): bool => $extendedParameterReflection->getName() === $parameterName ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -248,11 +244,7 @@ private function hasArgument(New_ $new, string $argumentName): bool { return array_any( $new->getArgs(), -<<<<<<< HEAD fn (Arg $arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === $argumentName -======= - fn ($arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === $argumentName ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php b/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php index 13710a213b9..309ea2428f2 100644 --- a/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php +++ b/rules/CodeQuality/Rector/FuncCall/ChangeArrayPushToArrayAssignRector.php @@ -101,10 +101,6 @@ public function refactor(Node $node): ?array private function hasArraySpread(FuncCall $funcCall): bool { -<<<<<<< HEAD return array_any($funcCall->getArgs(), fn (Arg $arg): bool => $arg->unpack); -======= - return array_any($funcCall->getArgs(), fn ($arg) => $arg->unpack); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php b/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php index 192740d5a02..4920eeeb450 100644 --- a/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php +++ b/rules/CodingStyle/ClassNameImport/ValueObject/PendingImports.php @@ -98,18 +98,12 @@ public function isShortImported(FullyQualifiedObjectType $fullyQualifiedObjectTy return true; } } -<<<<<<< HEAD return array_any( $this->functionImports, fn (FullyQualifiedObjectType $fullyQualifiedObjectType): bool => strtolower( $fullyQualifiedObjectType->getShortName() ) === $shortName -======= - return array_any( - $this->functionImports, - fn ($functionImport): bool => strtolower((string) $functionImport->getShortName()) === $shortName ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -126,10 +120,7 @@ public function isImportShortable(FullyQualifiedObjectType $fullyQualifiedObject return true; } } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any($this->functionImports, fn (Type $type): bool => $fullyQualifiedObjectType->equals($type)); } } diff --git a/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php b/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php index a20f27fc348..9cea1b90e14 100644 --- a/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php +++ b/rules/CodingStyle/Guard/ArrowFunctionAndClosureFirstClassCallableGuard.php @@ -189,11 +189,7 @@ private function isUsingThisInNonObjectContext(FuncCall|MethodCall|StaticCall $c */ private function isUsingByRef(array $params): bool { -<<<<<<< HEAD return array_any($params, fn (Param $param): bool => $param->byRef); -======= - return array_any($params, fn ($param) => $param->byRef); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -201,11 +197,7 @@ private function isUsingByRef(array $params): bool */ private function isUsingNamedArgs(array $args): bool { -<<<<<<< HEAD return array_any($args, fn (Arg $arg): bool => $arg->name instanceof Identifier); -======= - return array_any($args, fn ($arg): bool => $arg->name instanceof Identifier); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function isChainedCall(FuncCall|MethodCall|StaticCall $callLike): bool diff --git a/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php b/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php index c4269d5ff5f..5bc416d7f26 100644 --- a/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php +++ b/rules/DeadCode/NodeAnalyzer/NoDiscardCallAnalyzer.php @@ -85,13 +85,9 @@ public function isNoDiscardCall(Expr $expr): bool */ private function hasNoDiscardAttribute(array $attributes): bool { -<<<<<<< HEAD return array_any( $attributes, fn (AttributeReflection $attributeReflection): bool => $attributeReflection->getName() === 'NoDiscard' ); -======= - return array_any($attributes, fn ($attribute): bool => $attribute->getName() === 'NoDiscard'); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php b/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php index 50bac5a34d3..ddba64e1666 100644 --- a/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php +++ b/rules/DeadCode/PhpDoc/Guard/TemplateTypeRemovalGuard.php @@ -21,10 +21,6 @@ public function isLegal(Type $docType): bool $types = $docType instanceof UnionType ? $docType->getTypes() : [$docType]; -<<<<<<< HEAD return array_all($types, fn (Type $type): bool => ! $type instanceof TemplateType); -======= - return array_all($types, fn ($type): bool => ! $type instanceof TemplateType); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php b/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php index 617b4dbbcdd..74758264ba1 100644 --- a/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php +++ b/rules/DeadCode/Rector/ClassConst/RemoveUnusedPrivateClassConstantRector.php @@ -106,11 +106,7 @@ private function hasParentClassOfEnumSuffix(ClassReflection $classReflection): b { return array_any( $classReflection->getParentClassesNames(), -<<<<<<< HEAD fn (string $parentClassesName): bool => str_ends_with($parentClassesName, 'Enum') -======= - fn ($parentClassesName): bool => str_ends_with((string) $parentClassesName, 'Enum') ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php b/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php index cae3898681b..3bec4b1de46 100644 --- a/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php +++ b/rules/DeadCode/Rector/ClassLike/RemoveTypedPropertyNonMockDocblockRector.php @@ -142,16 +142,10 @@ private function isVarTagUnionTypeMockObject(PhpDocInfo $phpDocInfo, Property $p if (! $varTagType instanceof UnionType) { return false; } -<<<<<<< HEAD return array_any( $varTagType->getTypes(), fn (Type $unionedType): bool => $unionedType->isSuperTypeOf(new ObjectType(ClassName::MOCK_OBJECT))->yes() -======= - return array_any( - $varTagType->getTypes(), - fn ($unionedType) => $unionedType->isSuperTypeOf(new ObjectType(ClassName::MOCK_OBJECT))->yes() ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php index f6cf225d621..a7a11b1a215 100644 --- a/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php +++ b/rules/DeadCode/Rector/FunctionLike/NarrowWideUnionReturnTypeRector.php @@ -239,11 +239,7 @@ private function shouldSkipNode(ClassMethod|Function_|Closure|ArrowFunction $nod */ private function hasImplicitNullReturn(array $returnStatements): bool { -<<<<<<< HEAD return array_any($returnStatements, fn (Return_ $return): bool => ! $return->expr instanceof Expr); -======= - return array_any($returnStatements, fn ($returnStatement): bool => $returnStatement->expr === null); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** diff --git a/rules/DeadCode/Rector/If_/RemoveTypedPropertyDeadInstanceOfRector.php b/rules/DeadCode/Rector/If_/RemoveTypedPropertyDeadInstanceOfRector.php index 2a52fed02b9..29d919ea431 100644 --- a/rules/DeadCode/Rector/If_/RemoveTypedPropertyDeadInstanceOfRector.php +++ b/rules/DeadCode/Rector/If_/RemoveTypedPropertyDeadInstanceOfRector.php @@ -10,6 +10,7 @@ use PhpParser\Node\Expr\PropertyFetch; use PhpParser\Node\Expr\StaticPropertyFetch; use PhpParser\Node\Name; +use PhpParser\Node\Param; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\Do_; @@ -208,6 +209,6 @@ private function isInPropertyPromotedParams(Class_ $class, PropertyFetch|StaticP /** @var string $propertyName */ $propertyName = $this->getName($propertyFetch); $params = $this->promotedPropertyResolver->resolveFromClass($class); - return array_any($params, fn (Node $param): bool => $this->isName($param, $propertyName)); + return array_any($params, fn (Param $param): bool => $this->isName($param, $propertyName)); } } diff --git a/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php b/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php index 632452e0087..4ad533970b7 100644 --- a/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php +++ b/rules/DeadCode/Rector/Switch_/RemoveDuplicatedCaseInSwitchRector.php @@ -180,15 +180,11 @@ private function areSwitchStmtsEqualsAndWithBreak(Case_ $currentCase, Case_ $nex if (! $this->nodeComparator->areNodesEqual($currentCase->stmts, $nextCase->stmts)) { return false; } -<<<<<<< HEAD return array_any( $currentCase->stmts, fn (Stmt $stmt): bool => $stmt instanceof Break_ || $stmt instanceof Return_ ); -======= - return array_any($currentCase->stmts, fn ($stmt): bool => $stmt instanceof Break_ || $stmt instanceof Return_); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function areSwitchStmtsEqualsConsideringComments(Case_ $currentCase, Case_ $nextCase): bool diff --git a/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php b/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php index 7978dcf364e..c1b2e331449 100644 --- a/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php +++ b/rules/DeadCode/TypeNodeAnalyzer/GenericTypeNodeAnalyzer.php @@ -13,10 +13,6 @@ final class GenericTypeNodeAnalyzer public function hasGenericType(BracketsAwareUnionTypeNode $bracketsAwareUnionTypeNode): bool { $types = $bracketsAwareUnionTypeNode->types; -<<<<<<< HEAD return array_any($types, fn (TypeNode $typeNode): bool => $typeNode instanceof GenericTypeNode); -======= - return array_any($types, fn ($type): bool => $type instanceof GenericTypeNode); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php b/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php index 3b5e3bff2ef..fe1de1acf25 100644 --- a/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php +++ b/rules/EarlyReturn/Rector/If_/RemoveAlwaysElseRector.php @@ -175,10 +175,7 @@ private function doesNotLastStatementBreakFlow(If_ | ElseIf_ | Else_ $node): boo )) { return true; } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $lastStmt->elseifs, fn (If_|ElseIf_|Else_ $elseIf): bool => $this->doesNotLastStatementBreakFlow($elseIf) diff --git a/rules/Naming/VariableRenamer.php b/rules/Naming/VariableRenamer.php index 525c5f6acec..43c38939083 100644 --- a/rules/Naming/VariableRenamer.php +++ b/rules/Naming/VariableRenamer.php @@ -124,10 +124,7 @@ private function isParamInParentFunction(Variable $variable, ?FunctionLike $func )) { return false; } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $functionLike->getParams(), fn (Node|array $param): bool => $this->nodeNameResolver->isName($param, $variableName) diff --git a/rules/Php71/Rector/List_/ListToArrayDestructRector.php b/rules/Php71/Rector/List_/ListToArrayDestructRector.php index 4f2c0a6bf20..4dbdae1ee32 100644 --- a/rules/Php71/Rector/List_/ListToArrayDestructRector.php +++ b/rules/Php71/Rector/List_/ListToArrayDestructRector.php @@ -115,10 +115,6 @@ public function provideMinPhpVersion(): int private function hasPartialDestruct(List_ $list): bool { -<<<<<<< HEAD return array_any($list->items, fn (?ArrayItem $arrayItem): bool => ! $arrayItem instanceof ArrayItem); -======= - return array_any($list->items, fn ($listItem): bool => ! $listItem instanceof ArrayItem); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php b/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php index 0f8a010a829..1cf29e52be8 100644 --- a/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php +++ b/rules/Php74/NodeAnalyzer/ClosureArrowFunctionAnalyzer.php @@ -75,10 +75,7 @@ function (Node $node) use ($variables): bool { if (! $node instanceof FuncCall) { return false; } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $variables, fn (Variable $variable): bool => $this->compactFuncCallAnalyzer->isInCompact($node, $variable) diff --git a/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php b/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php index bc9eecbd009..563ff2afe82 100644 --- a/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php +++ b/rules/Php80/NodeAnalyzer/MatchSwitchAnalyzer.php @@ -35,14 +35,10 @@ public function __construct( */ public function isReturnCondsAndExprs(array $condAndExprs): bool { -<<<<<<< HEAD return array_any( $condAndExprs, fn (CondAndExpr $condAndExpr): bool => $condAndExpr->equalsMatchKind(MatchKind::RETURN) ); -======= - return array_any($condAndExprs, fn ($condAndExpr) => $condAndExpr->equalsMatchKind(MatchKind::RETURN)); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -111,11 +107,7 @@ public function haveCondAndExprsMatchPotential(array $condAndExprs): bool */ public function hasCondsAndExprDefaultValue(array $condAndExprs): bool { -<<<<<<< HEAD return array_any($condAndExprs, fn (CondAndExpr $condAndExpr): bool => $condAndExpr->getCondExprs() === null); -======= - return array_any($condAndExprs, fn ($condAndExpr): bool => $condAndExpr->getCondExprs() === null); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function hasDefaultValue(Match_ $match): bool diff --git a/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php b/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php index ee9d0ad85c4..53d35c91325 100644 --- a/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php +++ b/rules/Php80/NodeAnalyzer/SwitchAnalyzer.php @@ -127,10 +127,6 @@ private function hasBreakOrReturnOrEmpty(Case_ $case): bool private function containsCaseReturn(Case_ $case): bool { -<<<<<<< HEAD return array_any($case->stmts, fn (Stmt $stmt): bool => $stmt instanceof Return_); -======= - return array_any($case->stmts, fn ($stmt): bool => $stmt instanceof Return_); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php b/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php index 143caaa59f4..cd2038334ea 100644 --- a/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php +++ b/rules/Php80/Rector/Class_/ClassPropertyAssignToConstructorPromotionRector.php @@ -354,15 +354,11 @@ private function shouldSkipParam(Param $param): bool if (! $type instanceof UnionType) { return false; } -<<<<<<< HEAD return array_any( $type->types, fn (Identifier|IntersectionType|Name $type): bool => $this->isCallableTypeIdentifier($type) ); -======= - return array_any($type->types, fn (?Node $type): bool => $this->isCallableTypeIdentifier($type)); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function isCallableTypeIdentifier(?Node $node): bool diff --git a/rules/Php80/ValueObject/NestedAnnotationToAttribute.php b/rules/Php80/ValueObject/NestedAnnotationToAttribute.php index d981ac16748..7ab86e4112c 100644 --- a/rules/Php80/ValueObject/NestedAnnotationToAttribute.php +++ b/rules/Php80/ValueObject/NestedAnnotationToAttribute.php @@ -64,11 +64,7 @@ public function hasExplicitParameters(): bool { return array_any( $this->annotationPropertiesToAttributeClasses, -<<<<<<< HEAD fn (AnnotationPropertyToAttributeClass $annotationPropertyToAttributeClass): bool => is_string( -======= - fn ($annotationPropertyToAttributeClass): bool => is_string( ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) $annotationPropertyToAttributeClass->getAnnotationProperty() ) ); diff --git a/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php b/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php index 18d9547ffb9..1fa9153bcbe 100644 --- a/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php +++ b/rules/Php82/NodeManipulator/ReadonlyClassManipulator.php @@ -72,11 +72,7 @@ private function resolveParentClassReflections(Scope $scope): array */ private function hasNonTypedProperty(array $properties): bool { -<<<<<<< HEAD return array_any($properties, fn (Property $property): bool => ! $property->type instanceof Node); -======= - return array_any($properties, fn ($property): bool => $property->type === null); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function shouldSkip(Class_ $class, Scope $scope): bool @@ -159,14 +155,10 @@ private function shouldSkipConsumeTraitProperty(Class_ $class): bool */ private function hasReadonlyProperty(array $properties): bool { -<<<<<<< HEAD return array_any( $properties, fn (ReflectionProperty $reflectionProperty): bool => ! $reflectionProperty->isReadOnly() ); -======= - return array_any($properties, fn ($property): bool => ! $property->isReadOnly()); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -174,11 +166,7 @@ private function hasReadonlyProperty(array $properties): bool */ private function isExtendsReadonlyClass(array $parents): bool { -<<<<<<< HEAD return array_any($parents, fn (ClassReflection $classReflection): bool => $classReflection->isReadOnly()); -======= - return array_any($parents, fn ($parent) => $parent->isReadOnly()); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -186,11 +174,7 @@ private function isExtendsReadonlyClass(array $parents): bool */ private function hasWritableProperty(array $properties): bool { -<<<<<<< HEAD return array_any($properties, fn (Property $property): bool => ! $property->isReadonly()); -======= - return array_any($properties, fn ($property): bool => ! $property->isReadonly()); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function shouldSkipClass(Class_ $class): bool diff --git a/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php b/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php index f586449c2c5..c029df214fe 100644 --- a/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php +++ b/rules/Php83/Rector/ClassConst/AddTypeToConstRector.php @@ -163,11 +163,7 @@ public function isConstGuardedByParents(Const_ $const, array $parentClassReflect $constantName = $this->getName($const); return array_any( $parentClassReflections, -<<<<<<< HEAD fn (ClassReflection $parentClassReflection): bool => $parentClassReflection->hasConstant($constantName) -======= - fn ($parentClassReflection) => $parentClassReflection->hasConstant($constantName) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php b/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php index d45491c3ded..786244d45c5 100644 --- a/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php +++ b/rules/Php84/Rector/FuncCall/AddEscapeArgumentRector.php @@ -110,11 +110,7 @@ private function shouldSkipNamedArg(FuncCall|MethodCall $node): bool { return array_any( $node->getArgs(), -<<<<<<< HEAD fn (Arg $arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === 'escape' -======= - fn ($arg): bool => $arg->name instanceof Identifier && $arg->name->toString() === 'escape' ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/Privatization/Guard/OverrideByParentClassGuard.php b/rules/Privatization/Guard/OverrideByParentClassGuard.php index 8ac29a4c7f2..8bb42b00f3e 100644 --- a/rules/Privatization/Guard/OverrideByParentClassGuard.php +++ b/rules/Privatization/Guard/OverrideByParentClassGuard.php @@ -26,16 +26,10 @@ public function isLegal(Class_ $class): bool )) { return false; } -<<<<<<< HEAD return array_all( $class->implements, fn (Name $name): bool => $this->reflectionProvider->hasClass($name->toString()) -======= - return array_all( - $class->implements, - fn ($implement): bool => $this->reflectionProvider->hasClass($implement->toString()) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php b/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php index b124f6ec98d..b699e7e9bbd 100644 --- a/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php +++ b/rules/Privatization/VisibilityGuard/ClassMethodVisibilityGuard.php @@ -42,11 +42,7 @@ public function isClassMethodVisibilityGuardedByTrait( $methodName = $this->nodeNameResolver->getName($classMethod); return array_any( $parentTraitReflections, -<<<<<<< HEAD fn (ClassReflection $classReflection): bool => $classReflection->hasMethod($methodName) -======= - fn ($parentTraitReflection) => $parentTraitReflection->hasMethod($methodName) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php b/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php index 0b5a166e46b..e81297e81d5 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/BoolReturnTypeFromBooleanStrictReturnsRector.php @@ -170,16 +170,10 @@ private function isNativeBooleanReturnTypeFuncCall(FuncCall $funcCall): bool if (! $functionReflection->isBuiltin()) { return false; } -<<<<<<< HEAD return array_all( $functionReflection->getVariants(), fn (ExtendedParametersAcceptor $extendedParametersAcceptor): bool => $extendedParametersAcceptor->getNativeReturnType() -======= - return array_all( - $functionReflection->getVariants(), - fn ($extendedParametersAcceptor) => $extendedParametersAcceptor->getNativeReturnType() ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ->isBoolean() ->yes() ); diff --git a/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php b/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php index f31cf14e906..aa8da3d326a 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector.php @@ -236,10 +236,6 @@ private function refactorFunctionLike( private function hasAtLeastOneParamWithoutType(ClassMethod|Function_|Closure|ArrowFunction $functionLike): bool { -<<<<<<< HEAD return array_any($functionLike->params, fn (Param $param): bool => ! $param->type instanceof Node); -======= - return array_any($functionLike->params, fn ($param): bool => ! $param->type instanceof Node); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php index 36e01413682..27f12028eee 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/StrictArrayParamDimFetchRector.php @@ -199,16 +199,10 @@ private function isEchoed(Node $node, string $paramName): bool if (! $node instanceof Echo_) { return false; } -<<<<<<< HEAD return array_any( $node->exprs, fn (Expr $expr): bool => $expr instanceof Variable && $this->isName($expr, $paramName) -======= - return array_any( - $node->exprs, - fn ($expr): bool => $expr instanceof Variable && $this->isName($expr, $paramName) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -270,16 +264,10 @@ private function isReassignAndUseAsArg(Node $node, string $paramName): bool if ($node->expr->isFirstClassCallable()) { return false; } -<<<<<<< HEAD return array_any( $node->expr->getArgs(), fn (Arg $arg): bool => $arg->value instanceof Variable && $this->isName($arg->value, $paramName) -======= - return array_any( - $node->expr->getArgs(), - fn ($arg): bool => $arg->value instanceof Variable && $this->isName($arg->value, $paramName) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php b/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php index 7b0ac4dfefb..18439a43a02 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/StringReturnTypeFromStrictStringReturnsRector.php @@ -134,11 +134,7 @@ private function hasAlwaysStringScalarReturn(array $returns): bool { return array_all( $returns, -<<<<<<< HEAD fn (Return_ $return): bool => ! (! $return->expr instanceof String_ && ! $return->expr instanceof InterpolatedString) -======= - fn ($return): bool => ! (! $return->expr instanceof String_ && ! $return->expr instanceof InterpolatedString) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php b/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php index 49f6dd656ea..f014d56a3ae 100644 --- a/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php +++ b/rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php @@ -257,13 +257,9 @@ private function methodSignatureUsesCallableWithIteratorTypes(string $className, */ private function callUsesClosures(array $args): bool { -<<<<<<< HEAD return array_any( $args, fn (Arg|VariadicPlaceholder $arg): bool => $arg instanceof Arg && $arg->value instanceof Closure ); -======= - return array_any($args, fn ($arg): bool => $arg instanceof Arg && $arg->value instanceof Closure); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php b/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php index b243d9bb9b9..72d8f123bda 100644 --- a/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php +++ b/rules/TypeDeclaration/TypeAnalyzer/GenericClassStringTypeNormalizer.php @@ -12,10 +12,6 @@ { public function isAllGenericClassStringType(UnionType $unionType): bool { -<<<<<<< HEAD return array_all($unionType->getTypes(), fn (Type $type): bool => $type instanceof GenericClassStringType); -======= - return array_all($unionType->getTypes(), fn ($type): bool => $type instanceof GenericClassStringType); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php b/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php index 5c0044e42f9..d2cbf4d2cd5 100644 --- a/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php +++ b/rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockForDimFetchArrayFromAssignsRector.php @@ -208,11 +208,7 @@ private function isConstantArrayType(Type $returnedExprType): bool if ($returnedExprType instanceof UnionType) { return array_all( $returnedExprType->getTypes(), -<<<<<<< HEAD fn (Type $unionedType): bool => $unionedType instanceof ConstantArrayType -======= - fn ($unionedType): bool => $unionedType instanceof ConstantArrayType ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php b/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php index 285842c9805..a89a42de16b 100644 --- a/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php +++ b/src/BetterPhpDocParser/Guard/NewPhpDocFromPHPStanTypeGuard.php @@ -21,10 +21,6 @@ public function isLegal(Type $type): bool private function isLegalUnionType(UnionType $type): bool { -<<<<<<< HEAD return array_all($type->getTypes(), fn (Type $unionType): bool => ! $unionType instanceof MixedType); -======= - return array_all($type->getTypes(), fn ($unionType): bool => ! $unionType instanceof MixedType); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php b/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php index b2ca945d2c1..e556cf17118 100644 --- a/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php +++ b/src/BetterPhpDocParser/Printer/PhpDocInfoPrinter.php @@ -189,11 +189,7 @@ private function hasDocblockStart(string $output): bool { return array_any( self::DOCBLOCK_STARTS, -<<<<<<< HEAD fn (string $docblockStart): bool => str_starts_with($output, $docblockStart) -======= - fn ($docblockStart): bool => str_starts_with($output, (string) $docblockStart) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php b/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php index c7cd563c66f..54d37f3ea2c 100644 --- a/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php +++ b/src/BetterPhpDocParser/ValueObject/Parser/BetterTokenIterator.php @@ -95,11 +95,7 @@ public function partialTokens(int $start, int $end): array public function containsTokenType(int $type): bool { -<<<<<<< HEAD return array_any($this->getTokens(), fn (array $token): bool => $token[1] === $type); -======= - return array_any($this->getTokens(), fn ($token): bool => $token[1] === $type); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function nextTokenType(): ?int diff --git a/src/Configuration/VendorMissAnalyseGuard.php b/src/Configuration/VendorMissAnalyseGuard.php index 56b65e74351..172781fcf95 100644 --- a/src/Configuration/VendorMissAnalyseGuard.php +++ b/src/Configuration/VendorMissAnalyseGuard.php @@ -25,16 +25,10 @@ private function hasDowngradeSets(): bool { /** @var string[] $registeredRectorSets */ $registeredRectorSets = SimpleParameterProvider::provideArrayParameter(Option::REGISTERED_RECTOR_SETS); -<<<<<<< HEAD return array_any( $registeredRectorSets, fn (string $registeredRectorSet): bool => str_contains($registeredRectorSet, 'downgrade-') -======= - return array_any( - $registeredRectorSets, - fn ($registeredRectorSet): bool => str_contains((string) $registeredRectorSet, 'downgrade-') ->>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) ); } diff --git a/src/CustomRules/SimpleNodeDumper.php b/src/CustomRules/SimpleNodeDumper.php index d3d54ddbd15..5bee4c4bf3c 100644 --- a/src/CustomRules/SimpleNodeDumper.php +++ b/src/CustomRules/SimpleNodeDumper.php @@ -81,11 +81,7 @@ public static function dump(array|Node $node, bool $rootNode = true): string */ private static function isStringList(array $items): bool { -<<<<<<< HEAD return array_all($items, fn (mixed $item): bool => is_string($item)); -======= - return array_all($items, fn ($item): bool => is_string($item)); ->>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) } private static function dumpFlags(mixed $flags): string diff --git a/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php b/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php index d48e70c5919..cfd91937ce9 100644 --- a/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php +++ b/src/FamilyTree/NodeAnalyzer/ClassChildAnalyzer.php @@ -26,18 +26,11 @@ public function hasAbstractParentClassMethod(ClassReflection $classReflection, s if ($parentClassMethods === []) { return false; } -<<<<<<< HEAD -<<<<<<< HEAD return array_any( $parentClassMethods, fn (PhpMethodReflection $phpMethodReflection): bool => $phpMethodReflection->isAbstract() ); -======= -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) - return array_any($parentClassMethods, fn ($parentClassMethod) => $parentClassMethod->isAbstract()); ->>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) } /** diff --git a/src/NodeAnalyzer/ArgsAnalyzer.php b/src/NodeAnalyzer/ArgsAnalyzer.php index 8a086d508bf..d8dfafab50a 100644 --- a/src/NodeAnalyzer/ArgsAnalyzer.php +++ b/src/NodeAnalyzer/ArgsAnalyzer.php @@ -20,11 +20,7 @@ public function __construct( */ public function hasNamedArg(array $args): bool { -<<<<<<< HEAD return array_any($args, fn (Arg $arg): bool => $arg->name instanceof Identifier); -======= - return array_any($args, fn ($arg): bool => $arg->name instanceof Identifier); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** diff --git a/src/NodeAnalyzer/CallAnalyzer.php b/src/NodeAnalyzer/CallAnalyzer.php index 6527ca3997f..4c89e952fab 100644 --- a/src/NodeAnalyzer/CallAnalyzer.php +++ b/src/NodeAnalyzer/CallAnalyzer.php @@ -41,15 +41,11 @@ public function isObjectCall(Expr $expr): bool return $isObjectCallLeft || $isObjectCallRight; } -<<<<<<< HEAD return array_any( self::OBJECT_CALL_TYPES, fn (string $objectCallType): bool => $expr instanceof $objectCallType ); -======= - return array_any(self::OBJECT_CALL_TYPES, fn ($objectCallType): bool => $expr instanceof $objectCallType); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** @@ -57,11 +53,7 @@ public function isObjectCall(Expr $expr): bool */ public function doesIfHasObjectCall(array $ifs): bool { -<<<<<<< HEAD return array_any($ifs, fn (If_ $if): bool => $this->isObjectCall($if->cond)); -======= - return array_any($ifs, fn ($if): bool => $this->isObjectCall($if->cond)); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function isNewInstance(Variable $variable): bool diff --git a/src/NodeAnalyzer/CallLikeArgumentNameAdder.php b/src/NodeAnalyzer/CallLikeArgumentNameAdder.php index dda31e71409..25e2a2a9118 100644 --- a/src/NodeAnalyzer/CallLikeArgumentNameAdder.php +++ b/src/NodeAnalyzer/CallLikeArgumentNameAdder.php @@ -84,10 +84,7 @@ private function shouldSkip(CallLike $callLike): bool if ($args === []) { return true; } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any($args, fn ($arg) => $arg->unpack); } diff --git a/src/NodeAnalyzer/DoctrineEntityAnalyzer.php b/src/NodeAnalyzer/DoctrineEntityAnalyzer.php index e3053137fef..e9dce6221a8 100644 --- a/src/NodeAnalyzer/DoctrineEntityAnalyzer.php +++ b/src/NodeAnalyzer/DoctrineEntityAnalyzer.php @@ -49,16 +49,10 @@ public function hasClassReflectionAttribute(ClassReflection $classReflection): b if ($nativeReflectionClass->getAttributes() === []) { return false; } -<<<<<<< HEAD return array_any( self::DOCTRINE_MAPPING_CLASSES, fn (string $doctrineMappingClass): bool => $nativeReflectionClass->getAttributes( -======= - return array_any( - self::DOCTRINE_MAPPING_CLASSES, - fn (?string $doctrineMappingClass): bool => $nativeReflectionClass->getAttributes( ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) $doctrineMappingClass ) !== [] ); diff --git a/src/NodeAnalyzer/ParamAnalyzer.php b/src/NodeAnalyzer/ParamAnalyzer.php index 52108321aa9..b216d0b1f7c 100644 --- a/src/NodeAnalyzer/ParamAnalyzer.php +++ b/src/NodeAnalyzer/ParamAnalyzer.php @@ -103,11 +103,7 @@ public function isParamUsedInClassMethod(ClassMethod $classMethod, Param $param) */ public function hasPropertyPromotion(array $params): bool { -<<<<<<< HEAD return array_any($params, fn (Param $param): bool => $param->isPromoted()); -======= - return array_any($params, fn ($param) => $param->isPromoted()); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function isNullable(Param $param): bool @@ -143,14 +139,10 @@ public function isParamReassign(ClassMethod $classMethod, Param $param): bool private function isVariableInClosureUses(Closure $closure, Variable $variable): bool { -<<<<<<< HEAD return array_any( $closure->uses, fn (ClosureUse $use): bool => $this->nodeComparator->areNodesEqual($use->var, $variable) ); -======= - return array_any($closure->uses, fn ($use): bool => $this->nodeComparator->areNodesEqual($use->var, $variable)); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } private function isUsedAsArg(Node $node, Param $param): bool diff --git a/src/NodeAnalyzer/ScopeAnalyzer.php b/src/NodeAnalyzer/ScopeAnalyzer.php index 537b887289a..1734898b92e 100644 --- a/src/NodeAnalyzer/ScopeAnalyzer.php +++ b/src/NodeAnalyzer/ScopeAnalyzer.php @@ -18,13 +18,9 @@ final class ScopeAnalyzer public function isRefreshable(Node $node): bool { -<<<<<<< HEAD return array_all( self::NON_REFRESHABLE_NODES, fn (string $noScopeNode): bool => ! $node instanceof $noScopeNode ); -======= - return array_all(self::NON_REFRESHABLE_NODES, fn ($noScopeNode): bool => ! $node instanceof $noScopeNode); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/src/NodeAnalyzer/VariadicAnalyzer.php b/src/NodeAnalyzer/VariadicAnalyzer.php index 8cd2a4400a4..6c0b1b382ff 100644 --- a/src/NodeAnalyzer/VariadicAnalyzer.php +++ b/src/NodeAnalyzer/VariadicAnalyzer.php @@ -34,11 +34,7 @@ private function hasVariadicVariant(MethodReflection | FunctionReflection $funct { return array_any( $functionLikeReflection->getVariants(), -<<<<<<< HEAD fn (ParametersAcceptor $parametersAcceptor): bool => $parametersAcceptor->isVariadic() -======= - fn ($parametersAcceptor) => $parametersAcceptor->isVariadic() ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/src/NodeManipulator/ClassDependencyManipulator.php b/src/NodeManipulator/ClassDependencyManipulator.php index 532c68e5384..565ab0099a1 100644 --- a/src/NodeManipulator/ClassDependencyManipulator.php +++ b/src/NodeManipulator/ClassDependencyManipulator.php @@ -334,16 +334,10 @@ private function hasClassParentClassMethod(Class_ $class, string $methodName): b if (! $classReflection instanceof ClassReflection) { return false; } -<<<<<<< HEAD return array_any( $classReflection->getParents(), fn (ClassReflection $parentClassReflection): bool => $parentClassReflection->hasMethod($methodName) -======= - return array_any( - $classReflection->getParents(), - fn ($parentClassReflection) => $parentClassReflection->hasMethod($methodName) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -360,10 +354,7 @@ private function isParamInConstructor(Class_ $class, string $propertyName): bool if (! $constructClassMethod instanceof ClassMethod) { return false; } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any( $constructClassMethod->params, fn (Node|array $param): bool => $this->nodeNameResolver->isName($param, $propertyName) diff --git a/src/NodeManipulator/ClassMethodManipulator.php b/src/NodeManipulator/ClassMethodManipulator.php index a76618eb7fb..2d23690f4c6 100644 --- a/src/NodeManipulator/ClassMethodManipulator.php +++ b/src/NodeManipulator/ClassMethodManipulator.php @@ -57,16 +57,10 @@ public function hasParentMethodOrInterfaceMethod(Class_ $class, string $methodNa return true; } } -<<<<<<< HEAD return array_any( $classReflection->getInterfaces(), fn (ClassReflection $classReflection): bool => $classReflection->hasMethod($methodName) -======= - return array_any( - $classReflection->getInterfaces(), - fn ($interfaceReflection) => $interfaceReflection->hasMethod($methodName) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } diff --git a/src/NodeNameResolver/NodeNameResolver.php b/src/NodeNameResolver/NodeNameResolver.php index a8f6f301265..620ea64ecbd 100644 --- a/src/NodeNameResolver/NodeNameResolver.php +++ b/src/NodeNameResolver/NodeNameResolver.php @@ -60,10 +60,7 @@ public function isNames(Node $node, array $names): bool if ($nodeName === null) { return false; } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_any($names, fn (string $name): bool => $this->isStringName($nodeName, $name)); } diff --git a/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php b/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php index 96e2fb5fac5..40d773291e6 100644 --- a/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php +++ b/src/NodeTypeResolver/PHPStan/Type/StaticTypeAnalyzer.php @@ -54,10 +54,7 @@ private function isAlwaysTruableUnionType(Type $type): bool if (! $type instanceof UnionType) { return false; } -<<<<<<< HEAD -======= ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) return array_all($type->getTypes(), fn (Type $unionedType): bool => $this->isAlwaysTruableType($unionedType)); } diff --git a/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php b/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php index 3bda8748c24..e281cd14df3 100644 --- a/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php +++ b/src/PhpAttribute/NodeFactory/AnnotationToAttributeIntegerValueCaster.php @@ -91,12 +91,8 @@ private function containsInteger(Type $type): bool if (! $type instanceof UnionType) { return false; } -<<<<<<< HEAD return array_any($type->getTypes(), fn (Type $unionedType): bool => $unionedType->isInteger()->yes()); -======= - return array_any($type->getTypes(), fn ($unionedType) => $unionedType->isInteger()->yes()); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } /** diff --git a/src/PhpParser/Comparing/NodeComparator.php b/src/PhpParser/Comparing/NodeComparator.php index d9d5323c149..5bfac3d4c76 100644 --- a/src/PhpParser/Comparing/NodeComparator.php +++ b/src/PhpParser/Comparing/NodeComparator.php @@ -65,7 +65,7 @@ public function isNodeEqual(Node $singleNode, array $availableNodes): bool { return array_any( $availableNodes, - fn (Node|array|null $availableNode): bool => $this->areNodesEqual($singleNode, $availableNode) + fn (Node $availableNode): bool => $this->areNodesEqual($singleNode, $availableNode) ); } diff --git a/src/PhpParser/Enum/NodeGroup.php b/src/PhpParser/Enum/NodeGroup.php index e6f034690bf..43e3826488d 100644 --- a/src/PhpParser/Enum/NodeGroup.php +++ b/src/PhpParser/Enum/NodeGroup.php @@ -82,10 +82,6 @@ final class NodeGroup public static function isStmtAwareNode(Node $node): bool { -<<<<<<< HEAD return array_any(self::STMTS_AWARE, fn (string $stmtAwareClass): bool => $node instanceof $stmtAwareClass); -======= - return array_any(self::STMTS_AWARE, fn ($stmtAwareClass): bool => $node instanceof $stmtAwareClass); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } } diff --git a/src/PhpParser/Node/BetterNodeFinder.php b/src/PhpParser/Node/BetterNodeFinder.php index 7a626dc252f..5743cbf390c 100644 --- a/src/PhpParser/Node/BetterNodeFinder.php +++ b/src/PhpParser/Node/BetterNodeFinder.php @@ -113,11 +113,7 @@ public function hasInstancesOf(Node | array $nodes, array $types): bool return (bool) $this->nodeFinder->findFirst( $nodes, -<<<<<<< HEAD static fn (Node $node): bool => array_any($types, fn (string $type): bool => $node instanceof $type) -======= - static fn (Node $node): bool => array_any($types, fn ($type): bool => $node instanceof $type) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } diff --git a/src/PhpParser/Node/FileNode.php b/src/PhpParser/Node/FileNode.php index fa6295647d3..c39b2d0c27b 100644 --- a/src/PhpParser/Node/FileNode.php +++ b/src/PhpParser/Node/FileNode.php @@ -142,13 +142,9 @@ public function hasImport(FullyQualifiedObjectType $fullyQualifiedObjectType): b { return array_any( $this->resolveUsedImportTypes(), -<<<<<<< HEAD fn (AliasedObjectType|FullyQualifiedObjectType $useImport): bool => $useImport->equals( $fullyQualifiedObjectType ) -======= - fn ($useImport) => $useImport->equals($fullyQualifiedObjectType) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } @@ -227,11 +223,7 @@ public function getSubNodeNames(): array public function isNamespaced(): bool { -<<<<<<< HEAD return array_any($this->stmts, fn (Stmt $stmt): bool => $stmt instanceof Namespace_); -======= - return array_any($this->stmts, fn ($stmt): bool => $stmt instanceof Namespace_); ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) } public function getNamespace(): ?Namespace_ diff --git a/src/PhpParser/Node/Value/ValueResolver.php b/src/PhpParser/Node/Value/ValueResolver.php index 2b90631533c..77a9b830dec 100644 --- a/src/PhpParser/Node/Value/ValueResolver.php +++ b/src/PhpParser/Node/Value/ValueResolver.php @@ -117,11 +117,7 @@ public function getValue(Arg|Expr|InterpolatedStringPart $expr, bool $resolvedCl */ public function isValues(Expr $expr, array $expectedValues): bool { -<<<<<<< HEAD return array_any($expectedValues, fn (mixed $expectedValue): bool => $this->isValue($expr, $expectedValue)); -======= - return array_any($expectedValues, fn ($expectedValue): bool => $this->isValue($expr, $expectedValue)); ->>>>>>> 0ce3dbd107 ([php] bump to PHP 8.4 syntax) } public function isFalse(Expr $expr): bool diff --git a/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php b/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php index 9f25b7a1086..3dd34c32bd8 100644 --- a/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php +++ b/src/VendorLocker/NodeVendorLocker/ClassMethodParamVendorLockResolver.php @@ -48,11 +48,7 @@ private function hasParentInterfaceMethod(ClassReflection $classReflection, stri { return array_any( $classReflection->getInterfaces(), -<<<<<<< HEAD fn (ClassReflection $interfaceClassReflection): bool => $interfaceClassReflection->hasMethod($methodName) -======= - fn ($interfaceClassReflection) => $interfaceClassReflection->hasMethod($methodName) ->>>>>>> 424f600506 ([php] bump to PHP 8.4 syntax) ); } } From 44af1272c5ba883516ccf63bb21286b01acdf4fa Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 19 Jun 2026 14:13:00 +0000 Subject: [PATCH 4/4] [ci-review] Remove unused dependencies --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 0cd32612cb1..f63e938be50 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,6 @@ "symfony/console": "^6.4.24", "symfony/filesystem": "^7.4", "symfony/finder": "^6.4", - "symfony/polyfill-php84": "^1.38", "symfony/process": "^7.4", "symplify/easy-parallel": "^11.2.2", "symplify/rule-doc-generator-contracts": "^11.2",