| Total Complexity | 6 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class ID |
||
| 12 | { |
||
| 13 | private $value; |
||
| 14 | |||
| 15 | public function __construct($value) |
||
| 16 | { |
||
| 17 | if (! is_scalar($value) && (! is_object($value) || ! method_exists($value, '__toString'))) { |
||
| 18 | throw new InvalidArgumentException('ID constructor cannot be passed a non scalar value.'); |
||
| 19 | } |
||
| 20 | $this->value = $value; |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return bool|float|int|string |
||
| 25 | */ |
||
| 26 | public function val() |
||
| 27 | { |
||
| 28 | return $this->value; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function __toString() |
||
| 34 | } |
||
| 35 | } |
||
| 36 |