Skip to content

Commit

Permalink
Fix PropertiesExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 9, 2024
1 parent 0999cba commit 0209dd0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Rules/Doctrine/ORM/PropertiesExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use PHPStan\Rules\Properties\ReadWritePropertiesExtension;
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
use Throwable;
use function array_key_exists;
use function in_array;

class PropertiesExtension implements ReadWritePropertiesExtension
Expand Down Expand Up @@ -47,7 +46,7 @@ public function isAlwaysWritten(PropertyReflection $property, string $propertyNa

if (isset($metadata->fieldMappings[$propertyName])) {
$mapping = $metadata->fieldMappings[$propertyName];
if (array_key_exists('generated', $mapping) && $mapping['generated'] !== ClassMetadata::GENERATED_NEVER) {
if (isset($mapping['generated']) && $mapping['generated'] !== ClassMetadata::GENERATED_NEVER) {
return true;
}
}
Expand Down

0 comments on commit 0209dd0

Please sign in to comment.