[Scoped] Fixing Scoped build bin rector.php (#1174)

This commit is contained in:
Abdul Malik Ikhsan 2021-11-07 10:57:30 +07:00 committed by GitHub
parent 41eda59ff9
commit 66800f00f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,6 @@ use PHPStan\Analyser\Scope;
use PHPStan\Reflection\ClassReflection;
use PHPStan\Type\StaticType;
use Rector\BetterPhpDocParser\PhpDocParser\PhpDocFromTypeDeclarationDecorator;
use Rector\Core\Exception\ShouldNotHappenException;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
@ -74,7 +73,7 @@ CODE_SAMPLE
{
$scope = $node->getAttribute(AttributeKey::SCOPE);
if (! $scope instanceof Scope) {
throw new ShouldNotHappenException();
return null;
}
$classReflection = $scope->getClassReflection();