| 1 | <?php |
||
| 14 | abstract class AbstractParser implements ParserInterface |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * Constructs the parser with an optional parent parser |
||
| 18 | * |
||
| 19 | * @param ParserInterface $parent |
||
| 20 | */ |
||
| 21 | 13 | public function __construct(ParserInterface $parent = null) |
|
| 25 | |||
| 26 | /** |
||
| 27 | * Triggers a parse error |
||
| 28 | * |
||
| 29 | * @param TokenStream $stream |
||
| 30 | * @return void |
||
| 31 | */ |
||
| 32 | final public function err(TokenStream $stream) |
||
| 38 | } |
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: