Code Duplication    Length = 13-13 lines in 2 locations

src/Mpociot/ApiDoc/Generators/AbstractGenerator.php 2 locations

@@ 370-382 (lines=13) @@
367
                $attributeData['type'] = 'boolean';
368
                $attributeData['value'] = true;
369
                break;
370
            case 'after':
371
                $attributeData['type'] = 'date';
372
                $format = isset($attributeData['format']) ? $attributeData['format'] : DATE_RFC850;
373
374
                if (strtotime($parameters[0]) === false) {
375
                    // the `after` date refers to another parameter in the request
376
                    $paramName = $parameters[0];
377
                    $attributeData['description'][] = Description::parse($rule)->with($paramName)->getDescription();
378
                    $attributeData['value'] = date($format, strtotime('+1 day', strtotime($routeData['parameters'][$paramName]['value'])));
379
                } else {
380
                    $attributeData['description'][] = Description::parse($rule)->with(date($format, strtotime($parameters[0])))->getDescription();
381
                    $attributeData['value'] = date($format, strtotime('+1 day', strtotime($parameters[0])));
382
                }
383
                break;
384
            case 'alpha':
385
                $attributeData['description'][] = Description::parse($rule)->getDescription();
@@ 421-433 (lines=13) @@
418
                $attributeData['description'][] = Description::parse($rule)->with($parameters)->getDescription();
419
                $attributeData['value'] = $faker->numberBetween($parameters[0], $parameters[1]);
420
                break;
421
            case 'before':
422
                $attributeData['type'] = 'date';
423
                $format = isset($attributeData['format']) ? $attributeData['format'] : DATE_RFC850;
424
425
                if (strtotime($parameters[0]) === false) {
426
                    // the `before` date refers to another parameter in the request
427
                    $paramName = $parameters[0];
428
                    $attributeData['description'][] = Description::parse($rule)->with($paramName)->getDescription();
429
                    $attributeData['value'] = date($format, strtotime('-1 day', strtotime($routeData['parameters'][$paramName]['value'])));
430
                } else {
431
                    $attributeData['description'][] = Description::parse($rule)->with(date($format, strtotime($parameters[0])))->getDescription();
432
                    $attributeData['value'] = date($format, strtotime('-1 day', strtotime($parameters[0])));
433
                }
434
                break;
435
            case 'date_format':
436
                $attributeData['type'] = 'date';