Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| AFPSyntaxTree | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getRoot | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Extension\AbuseFilter\Parser; |
| 4 | |
| 5 | /** |
| 6 | * A class representing a whole AST generated by AFPTreeParser, holding AFPTreeNode's. This wrapper |
| 7 | * could be expanded in the future. For now, it's mostly useful for typehints, and to have an |
| 8 | * evalTree function in the evaluator. |
| 9 | */ |
| 10 | class AFPSyntaxTree { |
| 11 | public function __construct( private readonly ?AFPTreeNode $rootNode = null ) { |
| 12 | } |
| 13 | |
| 14 | public function getRoot(): ?AFPTreeNode { |
| 15 | return $this->rootNode; |
| 16 | } |
| 17 | } |