@@ -54,7 +54,7 @@ public function create(string $resourceClass, string $property, array $options =
54
54
[$ normalizationGroups , $ denormalizationGroups ] = $ this ->getEffectiveSerializerGroups ($ options , $ resourceClass );
55
55
56
56
$ propertyMetadata = $ this ->transformReadWrite ($ propertyMetadata , $ resourceClass , $ property , $ normalizationGroups , $ denormalizationGroups );
57
- $ propertyMetadata = $ this ->transformLinkStatus ($ propertyMetadata , $ resourceClass , $ property , $ normalizationGroups , $ denormalizationGroups );
57
+ $ propertyMetadata = $ this ->transformLinkStatus ($ propertyMetadata , $ normalizationGroups , $ denormalizationGroups );
58
58
} catch (ResourceClassNotFoundException $ e ) {
59
59
// No need to check link status if related class is not a resource
60
60
}
@@ -97,7 +97,7 @@ private function transformReadWrite(PropertyMetadata $propertyMetadata, string $
97
97
*
98
98
* @throws ResourceClassNotFoundException
99
99
*/
100
- private function transformLinkStatus (PropertyMetadata $ propertyMetadata , string $ resourceClass , string $ propertyName , array $ normalizationGroups = null , array $ denormalizationGroups = null ): PropertyMetadata
100
+ private function transformLinkStatus (PropertyMetadata $ propertyMetadata , array $ normalizationGroups = null , array $ denormalizationGroups = null ): PropertyMetadata
101
101
{
102
102
// No need to check link status if property is not readable and not writable
103
103
if (false === $ propertyMetadata ->isReadable () && false === $ propertyMetadata ->isWritable ()) {
@@ -109,7 +109,6 @@ private function transformLinkStatus(PropertyMetadata $propertyMetadata, string
109
109
return $ propertyMetadata ;
110
110
}
111
111
112
- $ propertyGroups = $ this ->getPropertySerializerGroups ($ resourceClass , $ propertyName );
113
112
$ relatedClass = $ type ->isCollection () && ($ collectionValueType = $ type ->getCollectionValueType ()) ? $ collectionValueType ->getClassName () : $ type ->getClassName ();
114
113
115
114
if (null === $ relatedClass ) {
@@ -120,11 +119,11 @@ private function transformLinkStatus(PropertyMetadata $propertyMetadata, string
120
119
$ relatedGroups = $ this ->getResourceSerializerGroups ($ relatedClass );
121
120
122
121
if (null === $ propertyMetadata ->isReadableLink ()) {
123
- $ propertyMetadata = $ propertyMetadata ->withReadableLink (null !== $ normalizationGroups && !empty (array_intersect ($ propertyGroups , $ relatedGroups )) && ! empty ( array_intersect ( $ normalizationGroups , $ relatedGroups )));
122
+ $ propertyMetadata = $ propertyMetadata ->withReadableLink (null !== $ normalizationGroups && !empty (array_intersect ($ normalizationGroups , $ relatedGroups )));
124
123
}
125
124
126
125
if (null === $ propertyMetadata ->isWritableLink ()) {
127
- $ propertyMetadata = $ propertyMetadata ->withWritableLink (null !== $ denormalizationGroups && !empty (array_intersect ($ propertyGroups , $ relatedGroups )) && ! empty ( array_intersect ( $ denormalizationGroups , $ relatedGroups )));
126
+ $ propertyMetadata = $ propertyMetadata ->withWritableLink (null !== $ denormalizationGroups && !empty (array_intersect ($ denormalizationGroups , $ relatedGroups )));
128
127
}
129
128
130
129
return $ propertyMetadata ;
0 commit comments