Skip to content

Commit 6dba109

Browse files
Fix php 8.4 compatible code on BitwiseFlagCleaner (#266)
* Fix php 8.4 compatible code BitwiseFlagCleaner ref https://github.com/rectorphp/rector/pull/8990/files#diff-6a4a6fe9ef9b7755c813ac48865f8dd16de0bff4ff4140b9f707b3ffa8e81e58 * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <[email protected]>
1 parent 2e0cde6 commit 6dba109

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rules/DowngradePhp72/NodeManipulator/BitwiseFlagCleaner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function __construct(
1818
) {
1919
}
2020

21-
public function cleanFuncCall(FuncCall $funcCall, BitwiseOr $bitwiseOr, string $flag, Expr $expr = null): void
21+
public function cleanFuncCall(FuncCall $funcCall, BitwiseOr $bitwiseOr, string $flag, ?Expr $expr = null): void
2222
{
2323
if ($bitwiseOr->left instanceof BitwiseOr) {
2424
/** @var BitwiseOr $leftLeft */

src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __construct(
6363

6464
public function decorateReturn(ClassMethod|Function_|Closure|ArrowFunction $functionLike): void
6565
{
66-
if ($functionLike->returnType === null) {
66+
if (! $functionLike->returnType instanceof Node) {
6767
return;
6868
}
6969

@@ -159,7 +159,7 @@ public function decorateReturnWithSpecificType(
159159
ClassMethod|Function_|Closure|ArrowFunction $functionLike,
160160
Type $requireType
161161
): bool {
162-
if ($functionLike->returnType === null) {
162+
if (! $functionLike->returnType instanceof Node) {
163163
return false;
164164
}
165165

0 commit comments

Comments
 (0)