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