Code Duplication    Length = 4-9 lines in 3 locations

src/Hydra/ApiDocumentationBuilder.php 2 locations

@@ 319-327 (lines=9) @@
316
            break;
317
        }
318
319
        if (!isset($hydraOperation['returns']) &&
320
            (
321
                ('GET' === $method && !$collection) ||
322
                'POST' === $method ||
323
                'PUT' === $method
324
            )
325
        ) {
326
            $hydraOperation['returns'] = $prefixedShortName;
327
        }
328
329
        if (!isset($hydraOperation['expects']) &&
330
            ('POST' === $method || 'PUT' === $method)) {
@@ 329-332 (lines=4) @@
326
            $hydraOperation['returns'] = $prefixedShortName;
327
        }
328
329
        if (!isset($hydraOperation['expects']) &&
330
            ('POST' === $method || 'PUT' === $method)) {
331
            $hydraOperation['expects'] = $prefixedShortName;
332
        }
333
334
        if (!isset($hydraOperation['@type'])) {
335
            $hydraOperation['@type'] = 'hydra:Operation';

src/Swagger/ApiDocumentationBuilder.php 1 location

@@ 222-230 (lines=9) @@
219
                break;
220
        }
221
222
        if (!isset($swaggerOperation[$methodSwagger]['returns']) &&
223
            (
224
                ('GET' === $method && !$collection) ||
225
                'POST' === $method ||
226
                'PUT' === $method
227
            )
228
        ) {
229
            $swaggerOperation[$methodSwagger]['returns'] = $prefixedShortName;
230
        }
231
232
        if (!isset($swaggerOperation[$methodSwagger]['expects']) &&
233
            ('POST' === $method || 'PUT' === $method)) {