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 */ 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; }