Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 424-436 (lines=13) @@
421
                $attributeData['type'] = 'boolean';
422
                $attributeData['value'] = true;
423
                break;
424
            case 'after':
425
                $attributeData['type'] = 'date';
426
                $format = isset($attributeData['format']) ? $attributeData['format'] : DATE_RFC850;
427
428
                if (strtotime($parameters[0]) === false) {
429
                    // the `after` date refers to another parameter in the request
430
                    $paramName = $parameters[0];
431
                    $attributeData['description'][] = Description::parse($rule)->with($paramName)->getDescription();
432
                    $attributeData['value'] = date($format, strtotime('+1 day', strtotime($routeData['parameters'][$paramName]['value'])));
433
                } else {
434
                    $attributeData['description'][] = Description::parse($rule)->with(date($format, strtotime($parameters[0])))->getDescription();
435
                    $attributeData['value'] = date($format, strtotime('+1 day', strtotime($parameters[0])));
436
                }
437
                break;
438
            case 'alpha':
439
                $attributeData['description'][] = Description::parse($rule)->getDescription();
@@ 475-487 (lines=13) @@
472
                $attributeData['description'][] = Description::parse($rule)->with($parameters)->getDescription();
473
                $attributeData['value'] = $faker->numberBetween($parameters[0], $parameters[1]);
474
                break;
475
            case 'before':
476
                $attributeData['type'] = 'date';
477
                $format = isset($attributeData['format']) ? $attributeData['format'] : DATE_RFC850;
478
479
                if (strtotime($parameters[0]) === false) {
480
                    // the `before` date refers to another parameter in the request
481
                    $paramName = $parameters[0];
482
                    $attributeData['description'][] = Description::parse($rule)->with($paramName)->getDescription();
483
                    $attributeData['value'] = date($format, strtotime('-1 day', strtotime($routeData['parameters'][$paramName]['value'])));
484
                } else {
485
                    $attributeData['description'][] = Description::parse($rule)->with(date($format, strtotime($parameters[0])))->getDescription();
486
                    $attributeData['value'] = date($format, strtotime('-1 day', strtotime($parameters[0])));
487
                }
488
                break;
489
            case 'date_format':
490
                $attributeData['type'] = 'date';