public function parse($rootPath)
 {
     $finder = new Finder();
     $sources = $finder->files()->name('*.php')->notName('*Test.php')->exclude(['cache', 'logs', 'vendor', 'tests', 'Test'])->in($rootPath);
     foreach ($sources as $file) {
         /** @var \SplFileInfo $file */
         $filePath = $file->getRealPath();
         $content = file_get_contents($filePath);
         $this->parser->parse($content, $filePath);
     }
     /** @var Model $model */
     $p = $this->parser;
     $model = $p();
     return $model;
 }
Ejemplo n.º 2
0
 /**
  * @test
  * @expectedException \DomainCoder\Metamodel\Code\Parser\ParseException
  */
 public function parseError()
 {
     $code = '<?php $aaa=-=';
     $this->parser->parse($code, '');
 }