Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
36 | private function read(): void |
||
37 | { |
||
38 | if (empty($contents = file_get_contents($this->file->getPathname()))) { |
||
39 | throw new InvalidArgumentException('file contents get fail.'); |
||
40 | } |
||
41 | |||
42 | if (is_null($ast = $this->parser->parse($contents))) { |
||
43 | throw new RuntimeException('file contents parse error.'); |
||
44 | } |
||
45 | |||
46 | // add visitor. |
||
47 | foreach ($this->visitors as $visitor) { |
||
48 | $this->traverser->addVisitor($visitor); |
||
49 | } |
||
50 | $this->traverser->traverse($ast); |
||
51 | } |
||
53 |