This may be used to simplify writing well-formatted code.
저자: Johannes M. Schmitt (schmittjoh@gmail.com)
예제 #1
0
 /**
  * @param AbstractModel $model
  * @return string
  */
 public function generate(AbstractModel $model)
 {
     $this->writer->reset();
     $builder = $this->factory->getBuilder($model);
     $builder->build($model);
     return $this->writer->getContent();
 }
예제 #2
0
 /**
  * @param DocblockInterface $model
  * @return void
  */
 protected function buildDocblock(DocblockInterface $model)
 {
     $this->ensureBlankLine();
     if ($this->config->getGenerateDocblock()) {
         $model->generateDocblock();
     }
     $docblock = $model->getDocblock();
     if (!$docblock->isEmpty() || $this->config->getGenerateEmptyDocblock()) {
         $this->writer->writeln($docblock->toString());
     }
 }
 public function testGetUnindentedDocComment()
 {
     $writer = new Writer();
     $comment = $writer->writeln('/**')->indent()->writeln(' * Foo.')->write(' */')->getContent();
     $this->assertEquals("/**\n * Foo.\n */", ReflectionUtils::getUnindentedDocComment($comment));
 }