| Total Complexity | 7 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class NodeScalarValue implements NodeValueInterface, ScalarValueInterface |
||
| 14 | { |
||
| 15 | |||
| 16 | private $data; |
||
| 17 | |||
| 18 | private $path; |
||
| 19 | |||
| 20 | 9 | public function __construct($data, PathInterface $path) |
|
| 21 | { |
||
| 22 | 9 | if (null !== $data && !is_scalar($data)) { |
|
| 23 | 4 | throw new Exception\InvalidNodeDataException($data, $path); |
|
| 24 | } |
||
| 25 | 5 | $this->data = $data; |
|
| 26 | 5 | $this->path = $path; |
|
| 27 | 5 | } |
|
| 28 | |||
| 29 | 5 | public function getData() |
|
| 32 | } |
||
| 33 | |||
| 34 | 5 | public function getPath(): PathInterface |
|
| 35 | { |
||
| 36 | 5 | return $this->path; |
|
| 37 | } |
||
| 38 | |||
| 39 | 5 | public function createEventIterator(): Iterator |
|
| 40 | { |
||
| 41 | 5 | return $this->createGenerator(); |
|
| 42 | } |
||
| 43 | |||
| 44 | 5 | private function createGenerator(): Generator |
|
| 47 | 5 | } |
|
| 48 | } |
||
| 49 |