Code Duplication    Length = 5-5 lines in 3 locations

src/Hydra/ApiDocumentationBuilder.php 2 locations

@@ 73-77 (lines=5) @@
70
            $prefixedShortName = ($iri = $resourceMetadata->getIri()) ? $iri : '#'.$shortName;
71
72
            $collectionOperations = [];
73
            if ($itemOperations = $resourceMetadata->getCollectionOperations()) {
74
                foreach ($itemOperations as $operationName => $collectionOperation) {
75
                    $collectionOperations[] = $this->getHydraOperation($resourceClass, $resourceMetadata, $operationName, $collectionOperation, $prefixedShortName, true);
76
                }
77
            }
78
79
            if (!empty($collectionOperations)) {
80
                $entrypointProperties[] = [
@@ 155-159 (lines=5) @@
152
153
            $itemOperations = [];
154
155
            if ($operations = $resourceMetadata->getItemOperations()) {
156
                foreach ($operations as $operationName => $itemOperation) {
157
                    $itemOperations[] = $this->getHydraOperation($resourceClass, $resourceMetadata, $operationName, $itemOperation, $prefixedShortName, false);
158
                }
159
            }
160
161
            $class['hydra:supportedOperation'] = $itemOperations;
162
            $classes[] = $class;

src/Swagger/ApiDocumentationBuilder.php 1 location

@@ 130-134 (lines=5) @@
127
                $properties[$shortName]['properties'] = $property;
128
            }
129
130
            if ($operations = $resourceMetadata->getItemOperations()) {
131
                foreach ($operations as $operationName => $itemOperation) {
132
                    $itemOperations = array_merge($itemOperations, $this->getSwaggerOperation($resourceClass, $resourceMetadata, $operationName, $itemOperation, $prefixedShortName, false));
133
                }
134
            }
135
            $itemOperationsDocs[$this->iriConverter->getIriFromResourceClass($resourceClass)] = $itemOperations;
136
            $classes[] = $class;
137
        }