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

@@ 229-237 (lines=9) @@
226
                break;
227
        }
228
229
        if (!isset($swaggerOperation[$methodSwagger]['returns']) &&
230
            (
231
                ('GET' === $method && !$collection) ||
232
                'POST' === $method ||
233
                'PUT' === $method
234
            )
235
        ) {
236
            $swaggerOperation[$methodSwagger]['returns'] = $prefixedShortName;
237
        }
238
239
        if (!isset($swaggerOperation[$methodSwagger]['expects']) &&
240
            ('POST' === $method || 'PUT' === $method)) {