저자: Johannes M. Schmitt (schmittjoh@gmail.com)
상속: extends AbstractModel, implements gossi\codegen\model\NamespaceInterface, implements gossi\codegen\model\DocblockInterface, use trait gossi\codegen\model\parts\QualifiedNameTrait, use trait gossi\codegen\model\parts\DocblockTrait, use trait gossi\codegen\model\parts\LongDescriptionTrait
예제 #1
0
 public function generateDocblock()
 {
     parent::generateDocblock();
     foreach ($this->constants as $constant) {
         $constant->generateDocblock();
     }
 }
예제 #2
0
 public function generateDocblock()
 {
     parent::generateDocblock();
     foreach ($this->properties as $prop) {
         $prop->generateDocblock();
     }
 }
 protected function visitUseStatements(AbstractPhpStruct $struct)
 {
     if ($useStatements = $struct->getUseStatements()) {
         $this->ensureBlankLine();
         foreach ($useStatements as $alias => $namespace) {
             if (false === strpos($namespace, '\\')) {
                 $commonName = $namespace;
             } else {
                 $commonName = substr($namespace, strrpos($namespace, '\\') + 1);
             }
             if (false === strpos($namespace, '\\') && !$struct->getNamespace()) {
                 //avoid fatal 'The use statement with non-compound name '$commonName' has no effect'
                 continue;
             }
             $this->writer->write('use ' . $namespace);
             if ($commonName !== $alias) {
                 $this->writer->write(' as ' . $alias);
             }
             $this->writer->write(";\n");
         }
         $this->ensureBlankLine();
     }
 }
 private function sortMethods(AbstractPhpStruct $model)
 {
     if ($this->config->isSortingEnabled() && ($methodSorting = $this->config->getMethodSorting()) !== false) {
         if (is_string($methodSorting)) {
             $methodSorting = ComparatorFactory::createMethodComparator($methodSorting);
         }
         $model->getMethods()->sort($methodSorting);
     }
 }