| 1 | <?php |
||
| 9 | abstract class BaseString extends BaseScalar |
||
| 10 | { |
||
| 11 | protected $value; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * BaseString constructor. |
||
| 15 | * |
||
| 16 | * @param string $value |
||
| 17 | */ |
||
| 18 | 27 | public function __construct(string $value) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * In this method you must add all the necessary validations. |
||
| 25 | * |
||
| 26 | * @param string $value |
||
| 27 | * @return void |
||
| 28 | */ |
||
| 29 | abstract protected function setValue(string $value): void; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | * |
||
| 34 | * @return string |
||
| 35 | */ |
||
| 36 | 15 | public function value(): string |
|
| 40 | |||
| 41 | /** |
||
| 42 | * @return string |
||
| 43 | */ |
||
| 44 | 3 | public function __toString(): string |
|
| 48 | } |
||
| 49 |