@@ -32,7 +32,7 @@ |
||
| 32 | 32 | /** @var Project */ |
| 33 | 33 | protected $project; |
| 34 | 34 | |
| 35 | - public function __construct(Project &$project) { |
|
| 35 | + public function __construct(Project&$project) { |
|
| 36 | 36 | $this->project = $project; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | private $indentLevel = 0; |
| 37 | 37 | /** @var string */ |
| 38 | - protected $content = '.. rst-class:: phpdoctorst' . PHP_EOL . PHP_EOL ; |
|
| 38 | + protected $content = '.. rst-class:: phpdoctorst' . PHP_EOL . PHP_EOL; |
|
| 39 | 39 | |
| 40 | 40 | public function getContent() { |
| 41 | 41 | return $this->content; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function addFieldList($key, $value) { |
| 61 | - $this->addLine(':'.self::escape($key).':'); |
|
| 61 | + $this->addLine(':' . self::escape($key) . ':'); |
|
| 62 | 62 | $this->indent()->addMultiline($value, true)->unindent(); |
| 63 | 63 | return $this; |
| 64 | 64 | } |
@@ -209,7 +209,7 @@ |
||
| 209 | 209 | $this->log('Build indexes.'); |
| 210 | 210 | $namespaces = $this->project->getNamespaces(); |
| 211 | 211 | $namespaces['\\'] = $this->project->getRootNamespace(); |
| 212 | - usort($namespaces, function (Namespace_ $a, Namespace_ $b) { |
|
| 212 | + usort($namespaces, function(Namespace_ $a, Namespace_ $b) { |
|
| 213 | 213 | return strcmp($a->getFqsen(), $b->getFqsen()); |
| 214 | 214 | }); |
| 215 | 215 | /** @var Namespace_ $namespace */ |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | return; |
| 48 | 48 | } |
| 49 | 49 | if ($type === PhpDomainBuilder::SECTION_BEFORE_DESCRIPTION) { |
| 50 | - if($element instanceof Class_) { |
|
| 50 | + if ($element instanceof Class_) { |
|
| 51 | 51 | $modifiers = $element->isAbstract() ? 'abstract' : ''; |
| 52 | 52 | $modifiers = $element->isFinal() ? ' final' : $modifiers; |
| 53 | 53 | $builder->addLine(':php:`' . $modifiers . ' class ' . RstBuilder::escape($builder->getElement()->getName()) . ' {}`'); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | /** @var Interface_ $interface */ |
| 53 | 53 | $interface = $builder->getElement(); |
| 54 | 54 | |
| 55 | - if(count($interface->getMethods()) > 0) { |
|
| 55 | + if (count($interface->getMethods()) > 0) { |
|
| 56 | 56 | $builder->addH3('Methods'); |
| 57 | 57 | foreach ($interface->getMethods() as $method) { |
| 58 | 58 | $args = ''; |
@@ -69,13 +69,13 @@ |
||
| 69 | 69 | $apiDocBuilder->setVerboseOutput(true); |
| 70 | 70 | $apiDocBuilder->setDebugOutput(true); |
| 71 | 71 | } |
| 72 | - if($input->getOption('public-only')) { |
|
| 72 | + if ($input->getOption('public-only')) { |
|
| 73 | 73 | $apiDocBuilder->addExtension(PublicOnlyExtension::class); |
| 74 | 74 | } |
| 75 | - if(!$input->getOption('show-private')) { |
|
| 75 | + if (!$input->getOption('show-private')) { |
|
| 76 | 76 | $apiDocBuilder->addExtension(NoPrivateExtension::class); |
| 77 | 77 | } |
| 78 | - if($input->getOption('element-toc')) { |
|
| 78 | + if ($input->getOption('element-toc')) { |
|
| 79 | 79 | $apiDocBuilder->addExtension(TocExtension::class); |
| 80 | 80 | } |
| 81 | 81 | $apiDocBuilder->build(); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @return mixed |
| 71 | 71 | */ |
| 72 | 72 | public static function getNamespace(Element $element) { |
| 73 | - return substr($element->getFqsen(), 0, strlen($element->getFqsen())-strlen('\\'. $element->getName())); |
|
| 73 | + return substr($element->getFqsen(), 0, strlen($element->getFqsen()) - strlen('\\' . $element->getName())); |
|
| 74 | 74 | //return str_replace('\\' . $element->getName(), '', $element->getFqsen()); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * @param Property $property |
| 165 | 165 | */ |
| 166 | 166 | private function addProperty(Property $property) { |
| 167 | - $modifiers = $property->isStatic() ? '' : ' static' ; |
|
| 167 | + $modifiers = $property->isStatic() ? '' : ' static'; |
|
| 168 | 168 | $this->beginPhpDomain('attr', $property->getVisibility() . $modifiers . ' ' . $property->getName()); |
| 169 | 169 | $docBlock = $property->getDocBlock(); |
| 170 | 170 | $this->addDocBlockDescription($property); |
@@ -239,10 +239,10 @@ discard block |
||
| 239 | 239 | $args .= self::escape($type) . '|'; |
| 240 | 240 | } |
| 241 | 241 | $args = substr($args, 0, -1) . ' '; |
| 242 | - if($argument->isVariadic()) { |
|
| 242 | + if ($argument->isVariadic()) { |
|
| 243 | 243 | $args .= '...'; |
| 244 | 244 | } |
| 245 | - if($argument->isByReference()) { |
|
| 245 | + if ($argument->isByReference()) { |
|
| 246 | 246 | $args .= '&'; |
| 247 | 247 | } |
| 248 | 248 | $args .= '$' . $argument->getName(); |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | if ($param !== null) { |
| 272 | 272 | $typString = $param->getType(); |
| 273 | 273 | // Remove first \ to allow references |
| 274 | - if(0 === strpos($typString, '\\')) { |
|
| 274 | + if (0 === strpos($typString, '\\')) { |
|
| 275 | 275 | $typString = substr($typString, 1); |
| 276 | 276 | } |
| 277 | - $this->addMultiline(':param '.self::escape($typString).' $' . $argument->getName() . ': ' . $param->getDescription(), true); |
|
| 277 | + $this->addMultiline(':param ' . self::escape($typString) . ' $' . $argument->getName() . ': ' . $param->getDescription(), true); |
|
| 278 | 278 | } |
| 279 | 279 | } |
| 280 | 280 | foreach ($docBlock->getTags() as $tag) { |
@@ -290,8 +290,8 @@ discard block |
||
| 290 | 290 | * @param $fqsen string |
| 291 | 291 | * @return string |
| 292 | 292 | */ |
| 293 | - public static function getLink($type, $fqsen, $description='') { |
|
| 294 | - if($description !== '') { |
|
| 293 | + public static function getLink($type, $fqsen, $description = '') { |
|
| 294 | + if ($description !== '') { |
|
| 295 | 295 | return ':php:' . $type . ':`' . RstBuilder::escape($description) . '<' . RstBuilder::escape(substr($fqsen, 1)) . '>`'; |
| 296 | 296 | } |
| 297 | 297 | return ':php:' . $type . ':`' . RstBuilder::escape(substr($fqsen, 1)) . '`'; |