Source
<?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 containing information on math functions.
*/
final class CMathFunctionData {
/**
* Known math functions along with number or range of required parameters.
*
* @var array
*/
private const PARAMETERS = [
'abs' => [['count' => 1]],
'acos' => [['count' => 1]],
'ascii' => [['count' => 1]],
'asin' => [['count' => 1]],
'atan' => [['count' => 1]],
'atan2' => [['count' => 2]],
'avg' => [['min' => 1]],
'between' => [['count' => 3]],
'bitand' => [['count' => 2]],
'bitlength' => [['count' => 1]],
'bitlshift' => [['count' => 2]],
'bitnot' => [['count' => 1]],
'bitor' => [['count' => 2]],
'bitrshift' => [['count' => 2]],
'bitxor' => [['count' => 2]],
'bytelength' => [['count' => 1]],
'cbrt' => [['count' => 1]],
'ceil' => [['count' => 1]],
'char' => [['count' => 1]],
'concat' => [['min' => 2]],
'cos' => [['count' => 1]],
'cosh' => [['count' => 1]],
'cot' => [['count' => 1]],
'count' => [['min' => 1, 'max' => 3]],
'date' => [['count' => 0]],
'dayofmonth' => [['count' => 0]],
'dayofweek' => [['count' => 0]],
'degrees' => [['count' => 1]],
'e' => [['count' => 0]],
'exp' => [['count' => 1]],
'expm1' => [['count' => 1]],
'floor' => [['count' => 1]],
'histogram_quantile' => [['min' => 5, 'step' => 2], ['count' => 2]],
'in' => [['min' => 2]],
'insert' => [['count' => 4]],
'jsonpath' => [['min' => 2, 'max' => 3]],