/** * 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(); } }
/** * 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)); }
/** * {@inheritdoc} */ protected function openBlock(WriterInterface $writer) { return $writer->writeln('/*'); }
/** * 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; }
/** * 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); } }