@@ -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 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | $param = $params[$argument->getName()]; |
| 261 | 261 | if ($param !== null) { |
| 262 | 262 | $typString = $param->getType(); |
| 263 | - $this->addMultiline(':param '.self::escape($typString).' $' . $argument->getName() . ': ' . self::typesToRst($typString) . ' ' . $param->getDescription(), true); |
|
| 263 | + $this->addMultiline(':param ' . self::escape($typString) . ' $' . $argument->getName() . ': ' . self::typesToRst($typString) . ' ' . $param->getDescription(), true); |
|
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | foreach ($docBlock->getTags() as $tag) { |
@@ -276,8 +276,8 @@ discard block |
||
| 276 | 276 | * @param $fqsen string |
| 277 | 277 | * @return string |
| 278 | 278 | */ |
| 279 | - public static function getLink($type, $fqsen, $description='') { |
|
| 280 | - if($description !== '') { |
|
| 279 | + public static function getLink($type, $fqsen, $description = '') { |
|
| 280 | + if ($description !== '') { |
|
| 281 | 281 | return ':php:' . $type . ':`' . RstBuilder::escape($description) . '<' . RstBuilder::escape(substr($fqsen, 1)) . '>`'; |
| 282 | 282 | } |
| 283 | 283 | return ':php:' . $type . ':`' . RstBuilder::escape(substr($fqsen, 1)) . '`'; |
@@ -333,44 +333,58 @@ discard block |
||
| 333 | 333 | $tags = $docBlock->getTagsByName($tagName); |
| 334 | 334 | switch ($tagName) { |
| 335 | 335 | case 'return': |
| 336 | - if (count($tags) === 0) continue; |
|
| 336 | + if (count($tags) === 0) { |
|
| 337 | + continue; |
|
| 338 | + } |
|
| 337 | 339 | /** @var Return_ $return */ |
| 338 | 340 | $return = $tags[0]; |
| 339 | 341 | $this->addMultiline(':Returns: ' . $return->getType() . ' ' . RstBuilder::escape($return->getDescription()), true); |
| 340 | 342 | break; |
| 341 | 343 | case 'var': |
| 342 | - if (count($tags) === 0) continue; |
|
| 344 | + if (count($tags) === 0) { |
|
| 345 | + continue; |
|
| 346 | + } |
|
| 343 | 347 | /** @var DocBlock\Tags\Var_ $return */ |
| 344 | 348 | $return = $tags[0]; |
| 345 | 349 | $this->addMultiline(':Type: ' . self::typesToRst($return->getType()) . ' ' . RstBuilder::escape($return->getDescription()), true); |
| 346 | 350 | break; |
| 347 | 351 | case 'throws': |
| 348 | - if (count($tags) === 0) continue; |
|
| 352 | + if (count($tags) === 0) { |
|
| 353 | + continue; |
|
| 354 | + } |
|
| 349 | 355 | /** @var Throws $tag */ |
| 350 | 356 | foreach ($tags as $tag) { |
| 351 | 357 | $this->addMultiline(':Throws: ' . $tag->getType() . ' ' . RstBuilder::escape($tag->getDescription()), true); |
| 352 | 358 | } |
| 353 | 359 | break; |
| 354 | 360 | case 'since': |
| 355 | - if (count($tags) === 0) continue; |
|
| 361 | + if (count($tags) === 0) { |
|
| 362 | + continue; |
|
| 363 | + } |
|
| 356 | 364 | /** @var Since $return */ |
| 357 | 365 | $return = $tags[0]; |
| 358 | 366 | $this->addMultiline(':Since: ' . $return->getVersion() . ' ' . RstBuilder::escape($return->getDescription()), true); |
| 359 | 367 | break; |
| 360 | 368 | case 'deprecated': |
| 361 | - if (count($tags) === 0) continue; |
|
| 369 | + if (count($tags) === 0) { |
|
| 370 | + continue; |
|
| 371 | + } |
|
| 362 | 372 | /** @var Deprecated $return */ |
| 363 | 373 | $return = $tags[0]; |
| 364 | 374 | $this->addMultiline(':Deprecated: ' . $return->getVersion() . ' ' . RstBuilder::escape($return->getDescription()), true); |
| 365 | 375 | break; |
| 366 | 376 | case 'see': |
| 367 | - if (count($tags) === 0) continue; |
|
| 377 | + if (count($tags) === 0) { |
|
| 378 | + continue; |
|
| 379 | + } |
|
| 368 | 380 | /** @var See $return */ |
| 369 | 381 | $return = $tags[0]; |
| 370 | 382 | $this->addMultiline(':See: ' . $return->getReference() . ' ' . RstBuilder::escape($return->getDescription()), true); |
| 371 | 383 | break; |
| 372 | 384 | case 'license': |
| 373 | - if (count($tags) === 0) continue; |
|
| 385 | + if (count($tags) === 0) { |
|
| 386 | + continue; |
|
| 387 | + } |
|
| 374 | 388 | /** @var DocBlock\Tags\BaseTag $return */ |
| 375 | 389 | $return = $tags[0]; |
| 376 | 390 | $this->addMultiline(':License: ' . RstBuilder::escape($return->getDescription()), true); |
@@ -400,8 +414,9 @@ discard block |
||
| 400 | 414 | $result .= $type . ' | '; |
| 401 | 415 | continue; |
| 402 | 416 | } |
| 403 | - if (0 === strpos($type, '\\')) |
|
| 404 | - $type = substr($type, 1); |
|
| 417 | + if (0 === strpos($type, '\\')) { |
|
| 418 | + $type = substr($type, 1); |
|
| 419 | + } |
|
| 405 | 420 | $result .= ':any:`' . RstBuilder::escape($type) . '` | '; |
| 406 | 421 | } |
| 407 | 422 | return substr($result, 0, -3); |