| 1 | <?php |
||
| 12 | abstract class AbstractRecursiveMatcher implements MatcherInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @param RecursiveParser $parser |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | 1 | public function __construct(RecursiveParser $parser) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * Parse given string and return its value |
||
| 25 | * |
||
| 26 | * @param string $str |
||
| 27 | * @param string $restrict Pipe-separated list of allowed matches (ignored if empty) |
||
| 28 | * @return mixed |
||
| 29 | */ |
||
| 30 | 1 | protected function recurse(string $str, string $restrict = '') |
|
| 34 | } |
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: