| 1 | <?php |
||
| 6 | final class Boundary |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var string |
||
| 10 | */ |
||
| 11 | private $identifier; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @param string $identifier |
||
| 15 | */ |
||
| 16 | 25 | public function __construct(string $identifier) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | 16 | public function __toString(): string |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @param string $line |
||
| 33 | * @return bool |
||
| 34 | */ |
||
| 35 | 5 | public function isOpening(string $line): bool |
|
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $line |
||
| 42 | * @return bool |
||
| 43 | */ |
||
| 44 | 5 | public function isClosing(string $line): bool |
|
| 48 | |||
| 49 | /** |
||
| 50 | * @return Boundary |
||
| 51 | */ |
||
| 52 | 4 | public static function newRandom() |
|
| 56 | |||
| 57 | /** |
||
| 58 | * @param string $value |
||
| 59 | */ |
||
| 60 | 25 | private function assert(string $value): void |
|
| 66 | |||
| 67 | /** |
||
| 68 | * @param string $value |
||
| 69 | * @return bool |
||
| 70 | */ |
||
| 71 | 25 | private function validate(string $value): bool |
|
| 88 | } |
||
| 89 |