| Total Complexity | 7 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class FizzBuzz |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Create a new instance class. |
||
| 9 | * |
||
| 10 | * @param int $start |
||
| 11 | * @param int $end |
||
| 12 | * @param int $fizz |
||
| 13 | * @param int $buzz |
||
| 14 | * @return void |
||
| 15 | */ |
||
| 16 | 1 | public function __construct( |
|
| 17 | protected int $start, |
||
| 18 | protected int $end, |
||
| 19 | protected int $fizz, |
||
| 20 | protected int $buzz |
||
| 21 | ) { |
||
| 22 | // |
||
| 23 | 1 | } |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Create a new instance class in a static way. |
||
| 27 | * |
||
| 28 | * @param int $start |
||
| 29 | * @param int $end |
||
| 30 | * @param int $fizz |
||
| 31 | * @param int $buzz |
||
| 32 | * @return static |
||
| 33 | */ |
||
| 34 | 1 | public static function make(int $start, int $end, int $fizz = 3, int $buzz = 5) |
|
| 35 | { |
||
| 36 | 1 | return new static($start, $end, $fizz, $buzz); |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Generate list of fizz buzz data. |
||
| 41 | * |
||
| 42 | * @return int[]|string[] |
||
| 43 | */ |
||
| 44 | 1 | public function generate(): array |
|
| 61 | } |
||
| 62 | } |
||
| 63 |