diff --git a/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictReturnNewAnalyzer.php b/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictReturnNewAnalyzer.php index f8afda0facf..f17183f5eae 100644 --- a/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictReturnNewAnalyzer.php +++ b/rules/TypeDeclaration/NodeAnalyzer/ReturnTypeAnalyzer/StrictReturnNewAnalyzer.php @@ -7,8 +7,6 @@ use PhpParser\Node\Expr\Closure; use PhpParser\Node\Expr\New_; use PhpParser\Node\Expr\Variable; -use PhpParser\Node\Expr\Yield_; -use PhpParser\Node\Expr\YieldFrom; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Expression; @@ -56,9 +54,6 @@ public function matchAlwaysReturnVariableNew($functionLike) : ?string if ($functionLike->stmts === null) { return null; } - if ($this->betterNodeFinder->hasInstancesOfInFunctionLikeScoped($functionLike, [Yield_::class, YieldFrom::class])) { - return null; - } $returns = $this->betterNodeFinder->findReturnsScoped($functionLike); if (!$this->returnAnalyzer->hasOnlyReturnWithExpr($functionLike, $returns)) { return null; diff --git a/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNewArrayRector.php b/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNewArrayRector.php index cf4d35142ca..a9e504374ed 100644 --- a/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNewArrayRector.php +++ b/rules/TypeDeclaration/Rector/ClassMethod/ReturnTypeFromStrictNewArrayRector.php @@ -8,8 +8,6 @@ use PhpParser\Node\Expr\Assign; use PhpParser\Node\Expr\Closure; use PhpParser\Node\Expr\Variable; -use PhpParser\Node\Expr\Yield_; -use PhpParser\Node\Expr\YieldFrom; use PhpParser\Node\Identifier; use PhpParser\Node\Stmt; use PhpParser\Node\Stmt\ClassMethod; @@ -127,10 +125,6 @@ public function refactorWithScope(Node $node, Scope $scope) : ?Node if ($variables === []) { return null; } - // 2. skip yields - if ($this->betterNodeFinder->hasInstancesOfInFunctionLikeScoped($node, [Yield_::class, YieldFrom::class])) { - return null; - } $returns = $this->betterNodeFinder->findReturnsScoped($node); if (!$this->returnAnalyzer->hasOnlyReturnWithExpr($node, $returns)) { return null; diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 9fab592afdd..5839d362a90 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '92f64ffc17e7ad969edf8e48cf02ba68f72b2efc'; + public const PACKAGE_VERSION = 'c5940d2cc1adbe39945e0a0f9029823a883671e6'; /** * @api * @var string */ - public const RELEASE_DATE = '2024-09-21 20:07:30'; + public const RELEASE_DATE = '2024-09-21 21:30:28'; /** * @var int */