@@ -70,37 +70,49 @@ |
||
70 | 70 | $tags = $docBlock->getTagsByName($tag); |
71 | 71 | switch ($tag) { |
72 | 72 | case 'return': |
73 | - if (sizeof($tags) === 0) continue; |
|
73 | + if (sizeof($tags) === 0) { |
|
74 | + continue; |
|
75 | + } |
|
74 | 76 | /** @var Return_ $return */ |
75 | 77 | $return = $tags[0]; |
76 | 78 | $this->addIndentMultiline($indent, ':returns: ' . $return->getType() . ' ' . $return->getDescription(), true); |
77 | 79 | break; |
78 | 80 | case 'throws': |
79 | - if (sizeof($tags) === 0) continue; |
|
81 | + if (sizeof($tags) === 0) { |
|
82 | + continue; |
|
83 | + } |
|
80 | 84 | /** @var Throws $return */ |
81 | 85 | $return = $tags[0]; |
82 | 86 | $this->addIndentMultiline($indent, ':throws: ' . $return->getType() . ' ' . $return->getDescription(), true); |
83 | 87 | break; |
84 | 88 | case 'since': |
85 | - if (sizeof($tags) === 0) continue; |
|
89 | + if (sizeof($tags) === 0) { |
|
90 | + continue; |
|
91 | + } |
|
86 | 92 | /** @var Since $return */ |
87 | 93 | $return = $tags[0]; |
88 | 94 | $this->addIndentMultiline($indent, ':since: ' . $return->getVersion() . ' ' . $return->getDescription(), true); |
89 | 95 | break; |
90 | 96 | case 'deprecated': |
91 | - if (sizeof($tags) === 0) continue; |
|
97 | + if (sizeof($tags) === 0) { |
|
98 | + continue; |
|
99 | + } |
|
92 | 100 | /** @var Deprecated $return */ |
93 | 101 | $return = $tags[0]; |
94 | 102 | $this->addIndentMultiline($indent, ':deprecated: ' . $return->getVersion() . ' ' . $return->getDescription(), true); |
95 | 103 | break; |
96 | 104 | case 'see': |
97 | - if (sizeof($tags) === 0) continue; |
|
105 | + if (sizeof($tags) === 0) { |
|
106 | + continue; |
|
107 | + } |
|
98 | 108 | /** @var See $return */ |
99 | 109 | $return = $tags[0]; |
100 | 110 | $this->addIndentMultiline($indent, ':see: ' . $return->getReference() . ' ' . $return->getDescription(), true); |
101 | 111 | break; |
102 | 112 | case 'license': |
103 | - if (sizeof($tags) === 0) continue; |
|
113 | + if (sizeof($tags) === 0) { |
|
114 | + continue; |
|
115 | + } |
|
104 | 116 | /** @var DocBlock\Tags\BaseTag $return */ |
105 | 117 | $return = $tags[0]; |
106 | 118 | $this->addIndentMultiline($indent, ':license: ' . $return->getDescription(), true); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ->addLine() |
40 | 40 | ->addLine('.. php:class:: ' . $interface->getName()) |
41 | 41 | ->addLine() |
42 | - ->addIndentLine(1,$interface->getName() . ' class') |
|
42 | + ->addIndentLine(1, $interface->getName() . ' class') |
|
43 | 43 | ->addLine(); |
44 | 44 | if ($docBlock) { |
45 | 45 | $this |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | foreach ($interface->getMethods() as $method) { |
52 | 52 | $docBlock = $method->getDocBlock(); |
53 | 53 | $params = []; |
54 | - if($docBlock !== null) { |
|
54 | + if ($docBlock !== null) { |
|
55 | 55 | /** @var Param $param */ |
56 | 56 | foreach ($docBlock->getTagsByName('param') as $param) { |
57 | 57 | $params[$param->getVariableName()] = $param; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $args .= '$' . $argument->getName() . ', '; |
63 | 63 | } |
64 | 64 | $args = substr($args, 0, -2); |
65 | - $this->addIndentLine(1, '.. php:method:: '.$method->getName().'('.$args.')'); |
|
65 | + $this->addIndentLine(1, '.. php:method:: ' . $method->getName() . '(' . $args . ')'); |
|
66 | 66 | $this->addLine(); |
67 | 67 | if ($docBlock) |
68 | 68 | $this->addIndentMultiline(2, $docBlock->getDescription()); |
@@ -64,16 +64,18 @@ |
||
64 | 64 | $args = substr($args, 0, -2); |
65 | 65 | $this->addIndentLine(1, '.. php:method:: '.$method->getName().'('.$args.')'); |
66 | 66 | $this->addLine(); |
67 | - if ($docBlock) |
|
68 | - $this->addIndentMultiline(2, $docBlock->getDescription()); |
|
67 | + if ($docBlock) { |
|
68 | + $this->addIndentMultiline(2, $docBlock->getDescription()); |
|
69 | + } |
|
69 | 70 | $this->addLine(); |
70 | 71 | |
71 | 72 | if (!empty($params)) { |
72 | 73 | foreach ($method->getArguments() as $argument) { |
73 | 74 | /** @var Param $param */ |
74 | 75 | $param = $params[$argument->getName()]; |
75 | - if ($param !== null) |
|
76 | - $this->addIndentMultiline(2, ':param ' . $param->getType() . ' $' . $argument->getName() . ' ' . $param->getDescription()); |
|
76 | + if ($param !== null) { |
|
77 | + $this->addIndentMultiline(2, ':param ' . $param->getType() . ' $' . $argument->getName() . ' ' . $param->getDescription()); |
|
78 | + } |
|
77 | 79 | } |
78 | 80 | } |
79 | 81 |
@@ -104,7 +104,9 @@ |
||
104 | 104 | foreach ($method->getArguments() as $argument) { |
105 | 105 | /** @var Param $param */ |
106 | 106 | $param = $params[$argument->getName()]; |
107 | - if ($param !== null) $this->addIndentMultiline(2, ':param ' . $param->getType() . ' $' . $argument->getName() . ': ' . $param->getDescription(), true); |
|
107 | + if ($param !== null) { |
|
108 | + $this->addIndentMultiline(2, ':param ' . $param->getType() . ' $' . $argument->getName() . ': ' . $param->getDescription(), true); |
|
109 | + } |
|
108 | 110 | } |
109 | 111 | foreach ($docBlock->getTags() as $tag) { |
110 | 112 | $this->addDocblockTag(2, $tag->getName(), $docBlock); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if (is_dir($namespaceDir)) |
106 | 106 | continue; |
107 | 107 | if (!mkdir($namespaceDir, 0755, true)) { |
108 | - throw new \Exception('Could not create directory '. $namespaceDir); |
|
108 | + throw new \Exception('Could not create directory ' . $namespaceDir); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | '; |
197 | 197 | |
198 | 198 | $namespaces = $this->project->getNamespaces(); |
199 | - usort($namespaces, function (Namespace_ $a, Namespace_ $b) { |
|
199 | + usort($namespaces, function(Namespace_ $a, Namespace_ $b) { |
|
200 | 200 | return strcmp($a->getFqsen(), $b->getFqsen()); |
201 | 201 | }); |
202 | 202 | foreach ($namespaces as $namespace) { |
@@ -71,7 +71,9 @@ discard block |
||
71 | 71 | $files = new \RecursiveIteratorIterator($dir); |
72 | 72 | |
73 | 73 | foreach ($files as $file) { |
74 | - if ($file->isDir()) continue; |
|
74 | + if ($file->isDir()) { |
|
75 | + continue; |
|
76 | + } |
|
75 | 77 | try { |
76 | 78 | $interfaceList[] = new LocalFile($file->getPathname()); |
77 | 79 | } catch (\Exception $e) { |
@@ -102,8 +104,9 @@ discard block |
||
102 | 104 | public function createDirectoryStructure() { |
103 | 105 | foreach ($this->project->getNamespaces() as $namespace) { |
104 | 106 | $namespaceDir = $this->dstDir . str_replace("\\", "/", $namespace->getFqsen()); |
105 | - if (is_dir($namespaceDir)) |
|
106 | - continue; |
|
107 | + if (is_dir($namespaceDir)) { |
|
108 | + continue; |
|
109 | + } |
|
107 | 110 | if (!mkdir($namespaceDir, 0755, true)) { |
108 | 111 | throw new \Exception('Could not create directory '. $namespaceDir); |
109 | 112 | } |
@@ -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 |