コード例 #1
0
ファイル: Compiler.php プロジェクト: pscheit/psc-cms
 public function compile(File $out, $flags = 0)
 {
     // 0x000000 geht leider noch nicht
     $this->cClass = clone $this->gClass;
     // mit leerer oder mit clone anfangen?
     $this->processExtensions();
     $this->classWriter->setClass($this->cClass, $this->classReader);
     $this->classWriter->write($out, array(), ClassWriter::OVERWRITE);
     $this->classWriter->syntaxCheck($out);
     return $this;
 }
コード例 #2
0
ファイル: EntityBuilder.php プロジェクト: pscheit/psc-cms
 /**
  * @return File
  */
 public function writeRepository(File $file = NULL, $overwrite = NULL)
 {
     $gClass = $this->getRepositoryGClass();
     $this->classWriter->setClass($gClass);
     if (!isset($file)) {
         $autoLoadRoot = $this->module->getEntitiesPath()->sub(str_repeat('../', count(explode('\\', $this->module->getEntitiesNamespace()))))->resolvePath();
         $file = Code::mapClassToFile($gClass->getFQN(), $autoLoadRoot);
     }
     $this->classWriter->write($file, array(), $overwrite);
     $this->classWriter->syntaxCheck($file);
     return $file;
 }
コード例 #3
0
ファイル: ClassWriterTest.php プロジェクト: pscheit/psc-cms
 public function testSyntaxCheckSuccess()
 {
     $writer = new ClassWriter();
     $this->assertTrue($writer->syntaxCheck(new File(__FILE__), 'return'));
 }