| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | public function detect(SplFileInfo $file) |
||
| 38 | { |
||
| 39 | $parser = (new ParserFactory)->create(ParserFactory::PREFER_PHP7); |
||
| 40 | $traverser = new NodeTraverser(); |
||
| 41 | |||
| 42 | $fileReport = new FileReport($file); |
||
| 43 | |||
| 44 | $traverser->addVisitor(new ParentConnectorVisitor()); |
||
| 45 | $traverser->addVisitor(new DetectorVisitor($fileReport, $this->option)); |
||
| 46 | |||
| 47 | $stmts = $parser->parse($file->getContents()); |
||
| 48 | $traverser->traverse($stmts); |
||
| 49 | |||
| 50 | return $fileReport; |
||
| 51 | } |
||
| 52 | } |
||
| 53 |