Skip to content

Commit

Permalink
EmptyOnNullableObjectToInstanceOfRector: skip phpdoc (#5034)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Sep 17, 2023
1 parent b26d507 commit 8ba3d90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
@@ -0,0 +1,20 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector\Fixture;

use Rector\Tests\TypeDeclaration\Rector\Empty_\EmptyOnNullableObjectToInstanceOfRector\Source\AnotherObject;

final class SkipPhpdoc
{
/**
* @param ?AnotherObject $anotherObject
*/
public function run($anotherObject)
{
if (! empty($anotherObject)) {
return false;
}

return true;
}
}
Expand Up @@ -86,7 +86,7 @@ public function refactor(Node $node): ?Node
return null;
}

$exprType = $this->getType($empty->expr);
$exprType = $this->nodeTypeResolver->getNativeType($empty->expr);
if (! $exprType instanceof ObjectType) {
return null;
}
Expand Down

0 comments on commit 8ba3d90

Please sign in to comment.