@@ -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 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | && (string)$namespace->getFqsen() !== (string)$currentNamespaceFqsen |
42 | 42 | ) { |
43 | 43 | // only keep first level children |
44 | - $childrenPath = substr((string)$namespace->getFqsen(), strlen((string)$this->currentNamespace->getFqsen())+1); |
|
44 | + $childrenPath = substr((string)$namespace->getFqsen(), strlen((string)$this->currentNamespace->getFqsen()) + 1); |
|
45 | 45 | if (strpos($childrenPath, '\\') === false) { |
46 | 46 | $childNamespaces[] = $namespace; |
47 | 47 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | $this->addH2('Functions'); |
106 | 106 | foreach ($this->currentNamespace->getFunctions() as $function) { |
107 | - $this->beginPhpDomain('function', $function->getName(). '()'); |
|
107 | + $this->beginPhpDomain('function', $function->getName() . '()'); |
|
108 | 108 | $this->endPhpDomain('function'); |
109 | 109 | } |
110 | 110 |
@@ -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 */ |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $apiDocBuilder->setVerboseOutput(true); |
63 | 63 | $apiDocBuilder->setDebugOutput(true); |
64 | 64 | } |
65 | - if($input->getOption('public-only')) { |
|
65 | + if ($input->getOption('public-only')) { |
|
66 | 66 | $apiDocBuilder->addExtension(PublicOnlyExtension::class); |
67 | 67 | } |
68 | 68 | $apiDocBuilder->build(); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $this->addH1(self::escape($trait->getFqsen())); |
40 | 40 | |
41 | 41 | $namespace = str_replace('\\' . $trait->getName(), '', $trait->getFqsen()); |
42 | - if($namespace !== '') { |
|
42 | + if ($namespace !== '') { |
|
43 | 43 | $this->beginPhpDomain('namespace', substr($namespace, 1), false); |
44 | 44 | } |
45 | 45 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | foreach ($trait->getMethods() as $method) { |
70 | 70 | $docBlock = $method->getDocBlock(); |
71 | 71 | $params = []; |
72 | - if($docBlock !== null) { |
|
72 | + if ($docBlock !== null) { |
|
73 | 73 | /** @var Param $param */ |
74 | 74 | foreach ($docBlock->getTagsByName('param') as $param) { |
75 | 75 | $params[$param->getVariableName()] = $param; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | /** @var Argument $argument */ |
80 | 80 | foreach ($method->getArguments() as $argument) { |
81 | 81 | // TODO: defaults, types |
82 | - $args .= ' $' . $argument->getName() . ', '; |
|
82 | + $args .= ' $' . $argument->getName() . ', '; |
|
83 | 83 | } |
84 | 84 | $args = substr($args, 0, -2); |
85 | 85 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $modifiers .= $method->isStatic() ? ' static' : ''; |
90 | 90 | $this->addLine('.. rst-class:: ' . $modifiers)->addLine(); |
91 | 91 | $this->indent(); |
92 | - $this->beginPhpDomain('method', $method->getName().'('.$args.')'); |
|
92 | + $this->beginPhpDomain('method', $method->getName() . '(' . $args . ')'); |
|
93 | 93 | $this->addDocBlockDescription($docBlock); |
94 | 94 | if (!empty($params)) { |
95 | 95 | foreach ($method->getArguments() as $argument) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $docBlock = $constant->getDocBlock(); |
56 | 56 | if ($docBlock) { |
57 | 57 | foreach ($docBlock->getTags() as $tag) { |
58 | - $this->addDocblockTag( $tag->getName(), $docBlock); |
|
58 | + $this->addDocblockTag($tag->getName(), $docBlock); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | $this->endPhpDomain(); |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | * @param $name string |
98 | 98 | * @param $indent bool Should indent after the section started |
99 | 99 | */ |
100 | - public function beginPhpDomain($type, $name, $indent=true) { |
|
100 | + public function beginPhpDomain($type, $name, $indent = true) { |
|
101 | 101 | // FIXME: Add checks if it is properly ended |
102 | - $this->addLine('.. php:' . $type . ':: '. $name)->addLine(); |
|
102 | + $this->addLine('.. php:' . $type . ':: ' . $name)->addLine(); |
|
103 | 103 | if ($indent === true) { |
104 | 104 | $this->indent(); |
105 | 105 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | /** |
109 | 109 | * @param string $type |
110 | 110 | */ |
111 | - public function endPhpDomain($type='') { |
|
111 | + public function endPhpDomain($type = '') { |
|
112 | 112 | $this->unindent(); |
113 | 113 | $this->addLine(); |
114 | 114 | } |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | |
43 | 43 | $this->addH1(self::escape($class->getName())); |
44 | 44 | |
45 | - $namespace = substr($class->getFqsen(), 0, strlen($class->getFqsen())-strlen('\\' . $class->getName())); |
|
46 | - if($namespace !== '') { |
|
45 | + $namespace = substr($class->getFqsen(), 0, strlen($class->getFqsen()) - strlen('\\' . $class->getName())); |
|
46 | + if ($namespace !== '') { |
|
47 | 47 | $this->beginPhpDomain('namespace', substr($namespace, 1), false); |
48 | 48 | } |
49 | 49 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $this->indent(); |
58 | 58 | $this->addDocBlockDescription($docBlock); |
59 | 59 | |
60 | - if($class instanceof Class_) { |
|
60 | + if ($class instanceof Class_) { |
|
61 | 61 | // Add class details |
62 | 62 | $parent = $class->getParent(); |
63 | 63 | if ($parent !== null) { |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | $docBlock = $interface->getDocBlock(); |
42 | 42 | $this->addH1(self::escape($interface->getFqsen()))->addLine(); |
43 | - if($namespace !== '') { |
|
43 | + if ($namespace !== '') { |
|
44 | 44 | $this->beginPhpDomain('namespace', substr($namespace, 1), false); |
45 | 45 | } |
46 | 46 | $this->beginPhpDomain('interface', $interface->getName(), false); |