1 | <?php |
||
29 | final class OperationMethodResolver implements OperationMethodResolverInterface |
||
30 | { |
||
31 | private $router; |
||
32 | private $resourceMetadataFactory; |
||
33 | |||
34 | public function __construct(RouterInterface $router, ResourceMetadataFactoryInterface $resourceMetadataFactory) |
||
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | public function getCollectionOperationMethod(string $resourceClass, string $operationName): string |
||
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | public function getItemOperationMethod(string $resourceClass, string $operationName): string |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function getCollectionOperationRoute(string $resourceClass, string $operationName): Route |
||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function getItemOperationRoute(string $resourceClass, string $operationName): Route |
||
71 | |||
72 | /** |
||
73 | * @param string $resourceClass |
||
74 | * @param string $operationName |
||
75 | * @param string $operationType |
||
76 | * |
||
77 | * @throws RuntimeException |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | private function getOperationMethod(string $resourceClass, string $operationName, string $operationType): string |
||
101 | |||
102 | /** |
||
103 | * Gets the route related to the given operation. |
||
104 | * |
||
105 | * @param string $resourceClass |
||
106 | * @param string $operationName |
||
107 | * @param string $operationType |
||
108 | * |
||
109 | * @throws RuntimeException |
||
110 | * |
||
111 | * @return Route |
||
112 | */ |
||
113 | private function getOperationRoute(string $resourceClass, string $operationName, string $operationType): Route |
||
133 | |||
134 | /** |
||
135 | * Gets the route name or null if not defined. |
||
136 | * |
||
137 | * @param ResourceMetadata $resourceMetadata |
||
138 | * @param string $operationName |
||
139 | * @param string $operationType |
||
140 | * |
||
141 | * @return string|null |
||
142 | */ |
||
143 | private function getRouteName(ResourceMetadata $resourceMetadata, string $operationName, string $operationType) |
||
151 | |||
152 | /** |
||
153 | * Gets the route with the given name. |
||
154 | * |
||
155 | * @param string $routeName |
||
156 | * |
||
157 | * @throws RuntimeException |
||
158 | * |
||
159 | * @return Route |
||
160 | */ |
||
161 | private function getRoute(string $routeName): Route |
||
171 | } |
||
172 |