| Total Complexity | 11 |
| Total Lines | 80 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | final class LatinLetter implements LabelGenerator |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $str; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * New instance. |
||
| 28 | */ |
||
| 29 | public function __construct(string $str = 'A') |
||
| 32 | } |
||
| 33 | |||
| 34 | public function filterLetter(string $str): string |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function format(string $label): string |
||
| 52 | { |
||
| 53 | return $label; |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | public function generate(int $nbLabels): \Iterator |
||
| 71 | } |
||
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Returns the starting Letter. |
||
| 76 | */ |
||
| 77 | public function startingAt(): string |
||
| 78 | { |
||
| 79 | return $this->str; |
||
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Return an instance with the starting Letter. |
||
| 84 | * |
||
| 85 | * This method MUST retain the state of the current instance, and return |
||
| 86 | * an instance that contains the starting Letter. |
||
| 87 | */ |
||
| 88 | public function startsWith(string $str): self |
||
| 99 | } |
||
| 100 | } |
||
| 101 |