Code Duplication    Length = 5-5 lines in 2 locations

src/Hydra/ApiDocumentationBuilder.php 1 location

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

src/Swagger/ApiDocumentationBuilder.php 1 location

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