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

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