@@ -76,7 +76,7 @@ public function normalize($object, $format = null, array $context = [])
76
76
$ prefixedShortName = $ resourceMetadata ->getIri () ?? "# $ shortName " ;
77
77
78
78
$ this ->populateEntrypointProperties ($ resourceClass , $ resourceMetadata , $ shortName , $ prefixedShortName , $ entrypointProperties );
79
- $ classes [] = $ this ->getClass ($ resourceClass , $ resourceMetadata , $ shortName , $ prefixedShortName );
79
+ $ classes [] = $ this ->getClass ($ resourceClass , $ resourceMetadata , $ shortName , $ prefixedShortName, $ context );
80
80
}
81
81
82
82
return $ this ->computeDoc ($ object , $ this ->getClasses ($ entrypointProperties , $ classes ));
@@ -125,14 +125,14 @@ private function populateEntrypointProperties(string $resourceClass, ResourceMet
125
125
/**
126
126
* Gets a Hydra class.
127
127
*/
128
- private function getClass (string $ resourceClass , ResourceMetadata $ resourceMetadata , string $ shortName , string $ prefixedShortName ): array
128
+ private function getClass (string $ resourceClass , ResourceMetadata $ resourceMetadata , string $ shortName , string $ prefixedShortName, array $ context ): array
129
129
{
130
130
$ class = [
131
131
'@id ' => $ prefixedShortName ,
132
132
'@type ' => 'hydra:Class ' ,
133
133
'rdfs:label ' => $ shortName ,
134
134
'hydra:title ' => $ shortName ,
135
- 'hydra:supportedProperty ' => $ this ->getHydraProperties ($ resourceClass , $ resourceMetadata , $ shortName , $ prefixedShortName ),
135
+ 'hydra:supportedProperty ' => $ this ->getHydraProperties ($ resourceClass , $ resourceMetadata , $ shortName , $ prefixedShortName, $ context ),
136
136
'hydra:supportedOperation ' => $ this ->getHydraOperations ($ resourceClass , $ resourceMetadata , $ prefixedShortName , false ),
137
137
];
138
138
@@ -175,7 +175,7 @@ private function getPropertyNameCollectionFactoryContext(ResourceMetadata $resou
175
175
/**
176
176
* Gets Hydra properties.
177
177
*/
178
- private function getHydraProperties (string $ resourceClass , ResourceMetadata $ resourceMetadata , string $ shortName , string $ prefixedShortName ): array
178
+ private function getHydraProperties (string $ resourceClass , ResourceMetadata $ resourceMetadata , string $ shortName , string $ prefixedShortName, array $ context ): array
179
179
{
180
180
$ properties = [];
181
181
foreach ($ this ->propertyNameCollectionFactory ->create ($ resourceClass , $ this ->getPropertyNameCollectionFactoryContext ($ resourceMetadata )) as $ propertyName ) {
@@ -185,7 +185,7 @@ private function getHydraProperties(string $resourceClass, ResourceMetadata $res
185
185
}
186
186
187
187
if ($ this ->nameConverter ) {
188
- $ propertyName = $ this ->nameConverter ->normalize ($ propertyName );
188
+ $ propertyName = $ this ->nameConverter ->normalize ($ propertyName, $ resourceClass , self :: FORMAT , $ context );
189
189
}
190
190
191
191
$ properties [] = $ this ->getProperty ($ propertyMetadata , $ propertyName , $ prefixedShortName , $ shortName );
0 commit comments