Skip to content

Commit

Permalink
Fix php 8.4 compatible code on BitwiseFlagCleaner (#266)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
samsonasik and actions-user authored Jan 27, 2025
1 parent 2e0cde6 commit 6dba109
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions src/PhpDocDecorator/PhpDocFromTypeDeclarationDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 6dba109

Please sign in to comment.