Code Duplication    Length = 5-5 lines in 3 locations

src/Hydra/ApiDocumentationBuilder.php 2 locations

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

src/Swagger/ApiDocumentationBuilder.php 1 location

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