@@ -47,7 +47,7 @@ public function normalize($propertyName, string $class = null, string $format =
47
47
return $ this ->normalizeFallback ($ propertyName , $ class , $ format , $ context );
48
48
}
49
49
50
- if (!isset ( self ::$ normalizeCache[ $ class ][ $ propertyName ])) {
50
+ if (!\array_key_exists ( $ class , self ::$ normalizeCache) || ! \array_key_exists ( $ propertyName , self :: $ normalizeCache [ $ class ])) {
51
51
self ::$ normalizeCache [$ class ][$ propertyName ] = $ this ->getCacheValueForNormalization ($ propertyName , $ class );
52
52
}
53
53
@@ -64,7 +64,7 @@ public function denormalize($propertyName, string $class = null, string $format
64
64
}
65
65
66
66
$ cacheKey = $ this ->getCacheKey ($ class , $ context );
67
- if (!isset ( self ::$ denormalizeCache[ $ cacheKey ][ $ propertyName ])) {
67
+ if (!\array_key_exists ( $ cacheKey , self ::$ denormalizeCache) || ! \array_key_exists ( $ propertyName , self :: $ denormalizeCache [ $ cacheKey ])) {
68
68
self ::$ denormalizeCache [$ cacheKey ][$ propertyName ] = $ this ->getCacheValueForDenormalization ($ propertyName , $ class , $ context );
69
69
}
70
70
@@ -78,7 +78,7 @@ private function getCacheValueForNormalization(string $propertyName, string $cla
78
78
}
79
79
80
80
$ attributesMetadata = $ this ->metadataFactory ->getMetadataFor ($ class )->getAttributesMetadata ();
81
- if (!isset ( $ attributesMetadata [ $ propertyName] )) {
81
+ if (!\array_key_exists ( $ propertyName, $ attributesMetadata )) {
82
82
return null ;
83
83
}
84
84
@@ -93,7 +93,7 @@ private function normalizeFallback(string $propertyName, string $class = null, s
93
93
private function getCacheValueForDenormalization (string $ propertyName , string $ class , array $ context ): ?string
94
94
{
95
95
$ cacheKey = $ this ->getCacheKey ($ class , $ context );
96
- if (!isset ( self ::$ attributesMetadataCache[ $ cacheKey ] )) {
96
+ if (!\array_key_exists ( $ cacheKey , self ::$ attributesMetadataCache )) {
97
97
self ::$ attributesMetadataCache [$ cacheKey ] = $ this ->getCacheValueForAttributesMetadata ($ class , $ context );
98
98
}
99
99
0 commit comments