/**
  * writeProperties
  *
  * @param WriterInterface $writer
  * @param ImportResolver $resolver
  *
  * @return void
  */
 protected function writeProperties(WriterInterface $writer, ImportResolver $resolver)
 {
     if (empty($this->properties)) {
         return;
     }
     if (!empty($this->traits)) {
         $writer->newline();
     }
     foreach ((array) $this->properties as $prop) {
         $writer->writeln($prop->generate())->newline();
     }
     if (empty($this->methods)) {
         $writer->popln();
     }
 }
示例#2
0
 /**
  * getObjectBody
  *
  * @param Writer $writer
  *
  * @return Writer
  */
 protected function writeObjectBody(WriterInterface $writer)
 {
     if (empty($this->methods)) {
         return $writer;
     }
     if ($this->hasItemsBeforeMethods()) {
         $writer->newline();
     }
     foreach ($this->methods as $method) {
         $writer->writeln($method)->newline();
     }
     $writer->popln();
     return $writer;
 }