@@ -154,6 +154,9 @@ discard block |
||
154 | 154 | ); |
155 | 155 | } |
156 | 156 | |
157 | +/** |
|
158 | + * @param integer $num |
|
159 | + */ |
|
157 | 160 | function assertArgs($num, $args, $name) { |
158 | 161 | if ($num != count($args)) { |
159 | 162 | die('Wrong argument count for ' . $name . '().'); |
@@ -213,10 +216,16 @@ discard block |
||
213 | 216 | /// Regex helper functions /// |
214 | 217 | ////////////////////////////// |
215 | 218 | |
219 | +/** |
|
220 | + * @param string $regex |
|
221 | + */ |
|
216 | 222 | function regex($regex) { |
217 | 223 | return '~' . LIB . '(?:' . str_replace('~', '\~', $regex) . ')~'; |
218 | 224 | } |
219 | 225 | |
226 | +/** |
|
227 | + * @param string $regex |
|
228 | + */ |
|
220 | 229 | function magicSplit($regex, $string) { |
221 | 230 | $pieces = preg_split(regex('(?:(?&string)|(?&comment)|(?&code))(*SKIP)(*FAIL)|' . $regex), $string); |
222 | 231 |
@@ -44,8 +44,6 @@ |
||
44 | 44 | /** |
45 | 45 | * Implements one or more interfaces. |
46 | 46 | * |
47 | - * @param Name|string $interface Name of interface to implement |
|
48 | - * @param Name|string $... More interfaces to implement |
|
49 | 47 | * |
50 | 48 | * @return $this The builder instance (for fluid interface) |
51 | 49 | */ |
@@ -25,8 +25,6 @@ |
||
25 | 25 | /** |
26 | 26 | * Extends one or more interfaces. |
27 | 27 | * |
28 | - * @param Name|string $interface Name of interface to extend |
|
29 | - * @param Name|string $... More interfaces to extend |
|
30 | 28 | * |
31 | 29 | * @return $this The builder instance (for fluid interface) |
32 | 30 | */ |
@@ -95,7 +95,7 @@ |
||
95 | 95 | /** |
96 | 96 | * Adds a statement. |
97 | 97 | * |
98 | - * @param Node|PhpParser\Builder $stmt The statement to add |
|
98 | + * @param Node\Expr\Print_ $stmt The statement to add |
|
99 | 99 | * |
100 | 100 | * @return $this The builder instance (for fluid interface) |
101 | 101 | */ |
@@ -142,7 +142,7 @@ |
||
142 | 142 | /** |
143 | 143 | * Sets the last part of the name. |
144 | 144 | * |
145 | - * @param string|array|self $name The name to set the last part to |
|
145 | + * @param string $name The name to set the last part to |
|
146 | 146 | */ |
147 | 147 | public function setLast($name) { |
148 | 148 | array_splice($this->parts, -1, 1, $this->prepareName($name)); |
@@ -105,6 +105,9 @@ |
||
105 | 105 | ); |
106 | 106 | } |
107 | 107 | |
108 | + /** |
|
109 | + * @param Name $type |
|
110 | + */ |
|
108 | 111 | protected function addAlias(Stmt\UseUse $use, $type) { |
109 | 112 | // Constant names are case sensitive, everything else case insensitive |
110 | 113 | if ($type === Stmt\Use_::TYPE_CONSTANT) { |
@@ -732,6 +732,9 @@ |
||
732 | 732 | return is_string($node) ? $node : $this->p($node); |
733 | 733 | } |
734 | 734 | |
735 | + /** |
|
736 | + * @param string $afterClassToken |
|
737 | + */ |
|
735 | 738 | protected function pClassCommon(Stmt\Class_ $node, $afterClassToken) { |
736 | 739 | return $this->pModifiers($node->type) |
737 | 740 | . 'class' . $afterClassToken |
@@ -175,6 +175,10 @@ discard block |
||
175 | 175 | return $this->{'p' . $node->getType()}($node); |
176 | 176 | } |
177 | 177 | |
178 | + /** |
|
179 | + * @param string $type |
|
180 | + * @param string $operatorString |
|
181 | + */ |
|
178 | 182 | protected function pInfixOp($type, Node $leftNode, $operatorString, Node $rightNode) { |
179 | 183 | list($precedence, $associativity) = $this->precedenceMap[$type]; |
180 | 184 | |
@@ -183,11 +187,19 @@ discard block |
||
183 | 187 | . $this->pPrec($rightNode, $precedence, $associativity, 1); |
184 | 188 | } |
185 | 189 | |
190 | + /** |
|
191 | + * @param string $type |
|
192 | + * @param string $operatorString |
|
193 | + */ |
|
186 | 194 | protected function pPrefixOp($type, $operatorString, Node $node) { |
187 | 195 | list($precedence, $associativity) = $this->precedenceMap[$type]; |
188 | 196 | return $operatorString . $this->pPrec($node, $precedence, $associativity, 1); |
189 | 197 | } |
190 | 198 | |
199 | + /** |
|
200 | + * @param string $type |
|
201 | + * @param string $operatorString |
|
202 | + */ |
|
191 | 203 | protected function pPostfixOp($type, Node $node, $operatorString) { |
192 | 204 | list($precedence, $associativity) = $this->precedenceMap[$type]; |
193 | 205 | return $this->pPrec($node, $precedence, $associativity, -1) . $operatorString; |
@@ -252,7 +264,7 @@ discard block |
||
252 | 264 | * |
253 | 265 | * @param string $string Not to be indented string |
254 | 266 | * |
255 | - * @return mixed String marked with $this->noIndentToken's. |
|
267 | + * @return string String marked with $this->noIndentToken's. |
|
256 | 268 | */ |
257 | 269 | protected function pNoIndent($string) { |
258 | 270 | return str_replace("\n", "\n" . $this->noIndentToken, $string); |
@@ -9,6 +9,9 @@ |
||
9 | 9 | |
10 | 10 | class ClassTest extends \PHPUnit_Framework_TestCase |
11 | 11 | { |
12 | + /** |
|
13 | + * @param string $class |
|
14 | + */ |
|
12 | 15 | protected function createClassBuilder($class) { |
13 | 16 | return new Class_($class); |
14 | 17 | } |