コード例 #1
0
ファイル: PhpMethod.php プロジェクト: symforce/symforce-core
 public function writeCallParent()
 {
     $ps = $this->getParameters();
     $_ps = array();
     if ($ps) {
         foreach ($ps as $p) {
             $_ps[] = '$' . $p->getName();
         }
     }
     $code = 'parent::' . $this->getName() . '(' . join(', ', $_ps) . ');';
     if ($this->_lazy_parent_return) {
         $this->_writer->write('return ');
     }
     $this->_writer->writeln($code);
 }
コード例 #2
0
 public function writeCache(\Symforce\CoreBundle\PhpHelper\PhpWriter $writer)
 {
     $default_value = $this->getDefaultValue();
     if ($this->_lazy) {
         $this->_class->getLazyWriter()->writeln('$this->' . $this->getName() . ' = ' . PhpHelper::compilePropertyValue($default_value) . ' ; ');
         $default_value = null;
     }
     $writer->write("\n");
     if ($this->getDocblock()) {
         $writer->writeln($this->getDocblock());
     }
     $writer->write($this->getVisibility())->write(' $')->write($this->getName());
     if (null !== $default_value) {
         $writer->write(' = ')->write(PhpHelper::compilePropertyValue($default_value));
     }
     $writer->writeln(";");
     if ($this->_get) {
         $this->genGetter();
     }
 }