Example #1
0
 /**
  * Create a new PHP Parser Lexer instance.
  *
  * @return Lexer
  */
 public function createLexer()
 {
     if ($this->project->getUseEmulativeParser() === true) {
         return new Emulative();
     }
     return new Lexer();
 }
Example #2
0
 /**
  * @covers ::__construct
  * @covers ::getUseEmulativeParser
  */
 public function testConstruct()
 {
     $processors = array($this->getMockForAbstractClass('MaartenStaa\\PHPTA\\Processors\\SmellInterface'));
     $reporters = array($this->getMockForAbstractClass('MaartenStaa\\PHPTA\\Processors\\ReporterInterface'));
     $project = new Project($processors, $reporters, false);
     $this->assertFalse($project->getUseEmulativeParser());
     $project = new Project($processors, $reporters, true);
     $this->assertTrue($project->getUseEmulativeParser());
 }