コード例 #1
0
ファイル: InterfaceWriter.php プロジェクト: lucidphp/writer
 /**
  * writeConstants
  *
  * @param WriterInterface $writer
  *
  * @return void
  */
 protected function writeConstants(WriterInterface $writer)
 {
     if (empty($this->constants)) {
         return;
     }
     foreach ($this->constants as $i => $constant) {
         $writer->writeln($constant->generate())->newline();
     }
     if (!$this->hasMethods()) {
         $writer->popln();
     }
 }
コード例 #2
0
 /**
  * writeUseReplacement
  *
  * @param WriterInterface $writer
  * @param string $alias
  * @param string $method
  * @param string $replacement
  * @param string $visibility
  *
  * @return void
  */
 protected function writeConflictReplacement(WriterInterface $writer, $alias, $method, $replacement)
 {
     $writer->writeln(sprintf('%s::%s insteadof %s;', $alias, $method, $replacement));
 }
コード例 #3
0
ファイル: CommentBlock.php プロジェクト: lucidphp/writer
 /**
  * {@inheritdoc}
  */
 protected function openBlock(WriterInterface $writer)
 {
     return $writer->writeln('/*');
 }
コード例 #4
0
ファイル: AbstractWriter.php プロジェクト: lucidphp/writer
 /**
  * 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;
 }
コード例 #5
0
ファイル: DocBlock.php プロジェクト: lucidphp/writer
 /**
  * blockLine
  *
  * @param WriterInterface $writer
  * @param array $lines
  *
  * @return void
  */
 protected function blockLines(WriterInterface $writer, array $lines)
 {
     if ($this->inline && 1 === count($lines)) {
         $this->setInline = true;
         $prefix = ' ';
     } else {
         $prefix = ' * ';
     }
     foreach ($lines as $line) {
         $writer->writeln($prefix . $line);
     }
 }