| 1 | <?php |
||
| 10 | abstract class AbstractValue implements ValueInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var mixed |
||
| 14 | */ |
||
| 15 | private $value; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * AbstractValue constructor. |
||
| 19 | * |
||
| 20 | * @param mixed $value |
||
| 21 | */ |
||
| 22 | 80 | public function __construct($value) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * {@inheritdoc} |
||
| 29 | */ |
||
| 30 | 52 | public function get() |
|
| 34 | |||
| 35 | /** |
||
| 36 | * {@inheritdoc} |
||
| 37 | */ |
||
| 38 | 1 | public function __invoke() |
|
| 42 | |||
| 43 | /** |
||
| 44 | * {@inheritdoc} |
||
| 45 | */ |
||
| 46 | abstract public function serialize(); |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | abstract public function unserialize($serialized); |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param string $string |
||
| 55 | * The string to hash. |
||
| 56 | * |
||
| 57 | * @return string |
||
| 58 | * The string's hash. |
||
| 59 | */ |
||
| 60 | 20 | protected function doHash(string $string) : string |
|
| 64 | |||
| 65 | /** |
||
| 66 | * Set the value. |
||
| 67 | * |
||
| 68 | * @param mixed $value |
||
| 69 | */ |
||
| 70 | 11 | protected function set($value) |
|
| 74 | } |
||
| 75 |