Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 390-402 (lines=13) @@
387
                $attributeData['type'] = 'boolean';
388
                $attributeData['value'] = true;
389
                break;
390
            case 'after':
391
                $attributeData['type'] = 'date';
392
                $format = isset($attributeData['format']) ? $attributeData['format'] : DATE_RFC850;
393
394
                if (strtotime($parameters[0]) === false) {
395
                    // the `after` date refers to another parameter in the request
396
                    $paramName = $parameters[0];
397
                    $attributeData['description'][] = Description::parse($rule)->with($paramName)->getDescription();
398
                    $attributeData['value'] = date($format, strtotime('+1 day', strtotime($routeData['parameters'][$paramName]['value'])));
399
                } else {
400
                    $attributeData['description'][] = Description::parse($rule)->with(date($format, strtotime($parameters[0])))->getDescription();
401
                    $attributeData['value'] = date($format, strtotime('+1 day', strtotime($parameters[0])));
402
                }
403
                break;
404
            case 'alpha':
405
                $attributeData['description'][] = Description::parse($rule)->getDescription();
@@ 441-453 (lines=13) @@
438
                $attributeData['description'][] = Description::parse($rule)->with($parameters)->getDescription();
439
                $attributeData['value'] = $faker->numberBetween($parameters[0], $parameters[1]);
440
                break;
441
            case 'before':
442
                $attributeData['type'] = 'date';
443
                $format = isset($attributeData['format']) ? $attributeData['format'] : DATE_RFC850;
444
445
                if (strtotime($parameters[0]) === false) {
446
                    // the `before` date refers to another parameter in the request
447
                    $paramName = $parameters[0];
448
                    $attributeData['description'][] = Description::parse($rule)->with($paramName)->getDescription();
449
                    $attributeData['value'] = date($format, strtotime('-1 day', strtotime($routeData['parameters'][$paramName]['value'])));
450
                } else {
451
                    $attributeData['description'][] = Description::parse($rule)->with(date($format, strtotime($parameters[0])))->getDescription();
452
                    $attributeData['value'] = date($format, strtotime('-1 day', strtotime($parameters[0])));
453
                }
454
                break;
455
            case 'date_format':
456
                $attributeData['type'] = 'date';