Source
private function validateHistFunctionExpressionRules(array $token, ?array $parent_token, ?int $position): bool {
<?php declare(strict_types = 0);
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* Class for validating trigger expressions and calculated item formulas.
*/
class CExpressionValidator extends CValidator {
/**
* An options array.
*
* Supported options:
* 'usermacros' => false Enable user macros usage in function parameters.
* 'lldmacros' => false Enable low-level discovery macros usage in function parameters.
* 'calculated' => false Validate expression as part of calculated item formula.
* 'partial' => false Validate partial expression (relaxed requirements).
*
* @var array
*/
private $options = [
'usermacros' => false,
'lldmacros' => false,
'calculated' => false,
'partial' => false
];
/**
* Provider of information on math functions.
*
* @var CMathFunctionData
*/
private $math_function_data;
/**
* Known math functions along with number or range of required parameters.
*
* @var array
*/
private $math_function_parameters = [];
/**
* Known math functions along with additional requirements for usage in expressions.
*
* @var array
*/
private $math_function_expression_rules = [];
/**
* Provider of information on history functions.
*