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'));
 }