Code Duplication    Length = 5-5 lines in 2 locations

src/Hydra/ApiDocumentationBuilder.php 1 location

@@ 261-265 (lines=5) @@
258
     */
259
    private function getHydraOperation(string $resourceClass, ResourceMetadata $resourceMetadata, string $operationName, array $operation, string $prefixedShortName, bool $collection) : array
260
    {
261
        if ($collection) {
262
            $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName);
263
        } else {
264
            $method = $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName);
265
        }
266
267
        $hydraOperation = $operation['hydra_context'] ?? [];
268
        $shortName = $resourceMetadata->getShortName();

src/Swagger/ApiDocumentationBuilder.php 1 location

@@ 163-167 (lines=5) @@
160
     */
161
    private function getSwaggerOperation(string $resourceClass, ResourceMetadata $resourceMetadata, string $operationName, array $operation, string $prefixedShortName, bool $collection) : array
162
    {
163
        if ($collection) {
164
            $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName);
165
        } else {
166
            $method = $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName);
167
        }
168
169
        $methodSwagger = strtolower($method);
170
        $swaggerOperation = $operation['swagger_context'] ?? [];