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

@@ 189-193 (lines=5) @@
186
     */
187
    private function getSwaggerOperation(string $resourceClass, ResourceMetadata $resourceMetadata, string $operationName, array $operation, string $prefixedShortName, bool $collection) : array
188
    {
189
        if ($collection) {
190
            $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName);
191
        } else {
192
            $method = $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName);
193
        }
194
        $methodSwagger = strtolower($method);
195
        $swaggerOperation = $operation['swagger_context'] ?? [];
196
        $shortName = $resourceMetadata->getShortName();