1 | <?php |
||
10 | class PrettyPrinter extends Standard { |
||
11 | |||
12 | /** |
||
13 | * Pretty prints an array of nodes (statements) and indents them optionally. |
||
14 | * |
||
15 | * @param Node[] $nodes Array of nodes |
||
16 | * @param bool $indent Whether to indent the printed nodes |
||
17 | * |
||
18 | * @return string Pretty printed statements |
||
19 | */ |
||
20 | 1 | protected function pStmts(array $nodes, bool $indent = true): string { |
|
50 | |||
51 | 2 | public function pExpr_Array(Array_ $node) { |
|
54 | } |
||
55 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: