From a667cc746ebbd44eda8c6ea24e140efe9e82a5d2 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 27 Jan 2025 23:08:20 +0700 Subject: [PATCH 1/2] Fix php 8.4 compatible code BitwiseFlagCleaner ref https://github.com/rectorphp/rector/pull/8990/files#diff-6a4a6fe9ef9b7755c813ac48865f8dd16de0bff4ff4140b9f707b3ffa8e81e58 --- rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php b/rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php index 9f966a4a..3e0e77d4 100644 --- a/rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php +++ b/rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php @@ -18,7 +18,7 @@ public function __construct( ) { } - public function cleanFuncCall(FuncCall $funcCall, BitwiseOr $bitwiseOr, string $flag, Expr $expr = null): void + public function cleanFuncCall(FuncCall $funcCall, BitwiseOr $bitwiseOr, string $flag, ?Expr $expr = null): void { if ($bitwiseOr->left instanceof BitwiseOr) { /** @var BitwiseOr $leftLeft */ From 1025ff1cb1c09d65e127ffecba7aed0bddb2eb50 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 27 Jan 2025 16:09:11 +0000 Subject: [PATCH 2/2] [ci-review] Rector Rectify --- src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php b/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php index d88576fd..a2cba62e 100644 --- a/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php +++ b/src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php @@ -63,7 +63,7 @@ public function __construct( public function decorateReturn(ClassMethod|Function_|Closure|ArrowFunction $functionLike): void { - if ($functionLike->returnType === null) { + if (! $functionLike->returnType instanceof Node) { return; } @@ -159,7 +159,7 @@ public function decorateReturnWithSpecificType( ClassMethod|Function_|Closure|ArrowFunction $functionLike, Type $requireType ): bool { - if ($functionLike->returnType === null) { + if (! $functionLike->returnType instanceof Node) { return false; }