Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
AFPSyntaxTree
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getRoot
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace 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 */
10class AFPSyntaxTree {
11    /**
12     * @var AFPTreeNode|null
13     */
14    private $rootNode;
15
16    /**
17     * @param AFPTreeNode|null $root
18     */
19    public function __construct( AFPTreeNode $root = null ) {
20        $this->rootNode = $root;
21    }
22
23    /**
24     * @return AFPTreeNode|null
25     */
26    public function getRoot(): ?AFPTreeNode {
27        return $this->rootNode;
28    }
29}