Skip to content

Commit

Permalink
try a simply class_exists fix
Browse files Browse the repository at this point in the history
  • Loading branch information
herndlm committed May 29, 2022
1 parent ebf4b37 commit c7586b6
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -6,6 +6,7 @@
use PHPStan\Reflection\PropertyReflection;
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use function class_exists;
use function in_array;
use const PHP_VERSION_ID;

Expand Down Expand Up @@ -41,8 +42,8 @@ public function isInitialized(PropertyReflection $property, string $propertyName

private function isEntityId(PropertyReflection $property, string $propertyName): bool
{
return PHP_VERSION_ID >= 80100
&&$property->getDeclaringClass()->getName() === 'MissingReadOnlyPropertyAssign\\Entity'
return class_exists('MissingReadOnlyPropertyAssign\\Entity')
&& $property->getDeclaringClass()->getName() === 'MissingReadOnlyPropertyAssign\\Entity'
&& in_array($propertyName, ['id'], true);
}

Expand Down

0 comments on commit c7586b6

Please sign in to comment.