Code Duplication    Length = 13-13 lines in 2 locations

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

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