mediawiki-extensions-AbuseF.../includes/Parser/AFPSyntaxTree.php
Andre Klapper 2fdd92fb96 Use explicit nullable type on parameter arguments (for PHP 8.4)
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.

Bug: T376276
Change-Id: I303342cf1a002d5f0afc77ce147ce9453ea5282e
2024-11-14 23:55:42 +00:00

30 lines
626 B
PHP

<?php
namespace MediaWiki\Extension\AbuseFilter\Parser;
/**
* A class representing a whole AST generated by AFPTreeParser, holding AFPTreeNode's. This wrapper
* could be expanded in the future. For now, it's mostly useful for typehints, and to have an
* evalTree function in the evaluator.
*/
class AFPSyntaxTree {
/**
* @var AFPTreeNode|null
*/
private $rootNode;
/**
* @param AFPTreeNode|null $root
*/
public function __construct( ?AFPTreeNode $root = null ) {
$this->rootNode = $root;
}
/**
* @return AFPTreeNode|null
*/
public function getRoot(): ?AFPTreeNode {
return $this->rootNode;
}
}