Skip to content

Commit 0209dd0

Browse files
committed
Fix PropertiesExtension
1 parent 0999cba commit 0209dd0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Rules/Doctrine/ORM/PropertiesExtension.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use PHPStan\Rules\Properties\ReadWritePropertiesExtension;
88
use PHPStan\Type\Doctrine\ObjectMetadataResolver;
99
use Throwable;
10-
use function array_key_exists;
1110
use function in_array;
1211

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

4847
if (isset($metadata->fieldMappings[$propertyName])) {
4948
$mapping = $metadata->fieldMappings[$propertyName];
50-
if (array_key_exists('generated', $mapping) && $mapping['generated'] !== ClassMetadata::GENERATED_NEVER) {
49+
if (isset($mapping['generated']) && $mapping['generated'] !== ClassMetadata::GENERATED_NEVER) {
5150
return true;
5251
}
5352
}

0 commit comments

Comments
 (0)