| 1 | <?php |
||
| 19 | class With extends Branch implements Annotation |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Construct the decorator with the specified expression as the first and only child node. |
||
| 23 | * |
||
| 24 | * @param \Zicht\Tool\Script\Node\Node $expr |
||
| 25 | * @param string $name |
||
| 26 | */ |
||
| 27 | public function __construct($expr, $name) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Allows the annotation to modify the buffer before the script is compiled. |
||
| 35 | * |
||
| 36 | * @param Buffer $buffer |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | public function beforeScript(Buffer $buffer) |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Allows the annotation to modify the buffer after the script is compiled. |
||
| 48 | * |
||
| 49 | * @param Buffer $buffer |
||
| 50 | * @return void |
||
| 51 | */ |
||
| 52 | public function afterScript(Buffer $buffer) |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Compiles the node into the buffer. |
||
| 59 | * |
||
| 60 | * @param \Zicht\Tool\Script\Buffer $buffer |
||
| 61 | * @return void |
||
| 62 | */ |
||
| 63 | public function compile(Buffer $buffer) |
||
| 66 | } |
||
| 67 |
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: