parse() публичный Метод

Parse a given file for defintions of classes, traits and interfaces
public parse ( TheSeer\Autoload\SourceFile $source ) : TheSeer\Autoload\ParseResult
$source TheSeer\Autoload\SourceFile file to process
Результат TheSeer\Autoload\ParseResult
Пример #1
0
 public function testGroupUseSyntaxWithConstIsHandeled()
 {
     $parser = new Parser();
     $rc = $parser->parse(new SourceFile(__DIR__ . '/_data/parser/groupuse2.php'));
     $units = array('some\\name\\space\\classd');
     $dependencies = array('my\\other\\name\\interfaceb', 'some\\name\\space\\foo');
     $this->assertEquals($units, $rc->getUnits());
     $this->assertEquals($dependencies, $rc->getDependenciesForUnit('some\\name\\space\\classd'));
 }
Пример #2
0
 public function testUseFunctionIsIgnored()
 {
     $parser = new \TheSeer\Autoload\Parser(true);
     $rc = $parser->parse(new SourceFile(__DIR__ . '/_data/parser/use10.php'));
     $this->assertEquals(array('demo'), $rc->getUnits());
     $this->assertEquals(array('name'), $rc->getDependenciesForUnit('demo'));
 }