@@ -115,7 +115,7 @@ public function getItemFromIri(string $iri, array $context = [])
115
115
/**
116
116
* {@inheritdoc}
117
117
*/
118
- public function getIriFromItem ($ item , int $ referenceType = UrlGeneratorInterface::DEFAULT ): string
118
+ public function getIriFromItem ($ item , int $ referenceType = UrlGeneratorInterface::DEFAULT_STRATEGY ): string
119
119
{
120
120
$ resourceClass = $ this ->getObjectClass ($ item );
121
121
@@ -128,16 +128,16 @@ public function getIriFromItem($item, int $referenceType = UrlGeneratorInterface
128
128
), $ e ->getCode (), $ e );
129
129
}
130
130
131
- return $ this ->getItemIriFromResourceClass ($ resourceClass , $ identifiers , UrlGeneratorInterface::DEFAULT === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
131
+ return $ this ->getItemIriFromResourceClass ($ resourceClass , $ identifiers , UrlGeneratorInterface::DEFAULT_STRATEGY === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
132
132
}
133
133
134
134
/**
135
135
* {@inheritdoc}
136
136
*/
137
- public function getIriFromResourceClass (string $ resourceClass , int $ referenceType = UrlGeneratorInterface::DEFAULT ): string
137
+ public function getIriFromResourceClass (string $ resourceClass , int $ referenceType = UrlGeneratorInterface::DEFAULT_STRATEGY ): string
138
138
{
139
139
try {
140
- return $ this ->router ->generate ($ this ->routeNameResolver ->getRouteName ($ resourceClass , OperationType::COLLECTION ), [], UrlGeneratorInterface::DEFAULT === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
140
+ return $ this ->router ->generate ($ this ->routeNameResolver ->getRouteName ($ resourceClass , OperationType::COLLECTION ), [], UrlGeneratorInterface::DEFAULT_STRATEGY === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
141
141
} catch (RoutingExceptionInterface $ e ) {
142
142
throw new InvalidArgumentException (sprintf ('Unable to generate an IRI for "%s". ' , $ resourceClass ), $ e ->getCode (), $ e );
143
143
}
@@ -146,14 +146,14 @@ public function getIriFromResourceClass(string $resourceClass, int $referenceTyp
146
146
/**
147
147
* {@inheritdoc}
148
148
*/
149
- public function getItemIriFromResourceClass (string $ resourceClass , array $ identifiers , int $ referenceType = UrlGeneratorInterface::DEFAULT ): string
149
+ public function getItemIriFromResourceClass (string $ resourceClass , array $ identifiers , int $ referenceType = UrlGeneratorInterface::DEFAULT_STRATEGY ): string
150
150
{
151
151
$ routeName = $ this ->routeNameResolver ->getRouteName ($ resourceClass , OperationType::ITEM );
152
152
153
153
try {
154
154
$ identifiers = $ this ->generateIdentifiersUrl ($ identifiers , $ resourceClass );
155
155
156
- return $ this ->router ->generate ($ routeName , ['id ' => implode ('; ' , $ identifiers )], UrlGeneratorInterface::DEFAULT === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
156
+ return $ this ->router ->generate ($ routeName , ['id ' => implode ('; ' , $ identifiers )], UrlGeneratorInterface::DEFAULT_STRATEGY === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
157
157
} catch (RoutingExceptionInterface $ e ) {
158
158
throw new InvalidArgumentException (sprintf (
159
159
'Unable to generate an IRI for "%s". ' ,
@@ -165,10 +165,10 @@ public function getItemIriFromResourceClass(string $resourceClass, array $identi
165
165
/**
166
166
* {@inheritdoc}
167
167
*/
168
- public function getSubresourceIriFromResourceClass (string $ resourceClass , array $ context , int $ referenceType = UrlGeneratorInterface::DEFAULT ): string
168
+ public function getSubresourceIriFromResourceClass (string $ resourceClass , array $ context , int $ referenceType = UrlGeneratorInterface::DEFAULT_STRATEGY ): string
169
169
{
170
170
try {
171
- return $ this ->router ->generate ($ this ->routeNameResolver ->getRouteName ($ resourceClass , OperationType::SUBRESOURCE , $ context ), $ context ['subresource_identifiers ' ], UrlGeneratorInterface::DEFAULT === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
171
+ return $ this ->router ->generate ($ this ->routeNameResolver ->getRouteName ($ resourceClass , OperationType::SUBRESOURCE , $ context ), $ context ['subresource_identifiers ' ], UrlGeneratorInterface::DEFAULT_STRATEGY === $ referenceType ? $ this ->urlGenerationStrategy : $ referenceType );
172
172
} catch (RoutingExceptionInterface $ e ) {
173
173
throw new InvalidArgumentException (sprintf ('Unable to generate an IRI for "%s". ' , $ resourceClass ), $ e ->getCode (), $ e );
174
174
}
0 commit comments