@@ -27,7 +27,6 @@ |
||
| 27 | 27 | * @param array $operation The operation metadata |
| 28 | 28 | * @param string|bool $operationType One of the constants defined in ApiPlatform\Core\Api\OperationType |
| 29 | 29 | * If the property is a boolean, true represents OperationType::COLLECTION, false is for OperationType::ITEM |
| 30 | - * @param string $operationName The operation name |
|
| 31 | 30 | * |
| 32 | 31 | * @return string |
| 33 | 32 | */ |
@@ -50,16 +50,16 @@ |
||
| 50 | 50 | { |
| 51 | 51 | if (OperationType::SUBRESOURCE === $operationType = OperationTypeDeprecationHelper::getOperationType($operationType)) { |
| 52 | 52 | if (!isset($subresourceContext['property'])) { |
| 53 | - throw new InvalidArgumentException('Missing "property" to generate a route name from a subresource'); |
|
| 53 | + throw new InvalidArgumentException('Missing "property" to generate a route name from a subresource'); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return sprintf( |
| 57 | - '%s%s_%s_%s%s', |
|
| 58 | - static::ROUTE_NAME_PREFIX, |
|
| 59 | - self::routeNameResolver($resourceShortName), |
|
| 60 | - self::routeNameResolver($subresourceContext['property'], $subresourceContext['collection'] ?? false), |
|
| 61 | - $operationName, |
|
| 62 | - self::SUBRESOURCE_SUFFIX |
|
| 57 | + '%s%s_%s_%s%s', |
|
| 58 | + static::ROUTE_NAME_PREFIX, |
|
| 59 | + self::routeNameResolver($resourceShortName), |
|
| 60 | + self::routeNameResolver($subresourceContext['property'], $subresourceContext['collection'] ?? false), |
|
| 61 | + $operationName, |
|
| 62 | + self::SUBRESOURCE_SUFFIX |
|
| 63 | 63 | ); |
| 64 | 64 | } |
| 65 | 65 | |
@@ -13,7 +13,6 @@ |
||
| 13 | 13 | |
| 14 | 14 | namespace ApiPlatform\Core\Bridge\Symfony\Routing; |
| 15 | 15 | |
| 16 | -use ApiPlatform\Core\Api\OperationType; |
|
| 17 | 16 | use ApiPlatform\Core\Api\OperationTypeDeprecationHelper; |
| 18 | 17 | use ApiPlatform\Core\Exception\InvalidArgumentException; |
| 19 | 18 | use ApiPlatform\Core\PathResolver\OperationPathResolverInterface; |