Source
return array_key_exists('parameters', $this->params_raw) ? count($this->params_raw['parameters']) : 0;
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/**
* Class is used to validate and parse a trigger function.
*/
class C10FunctionParser extends CParser {
const STATE_NEW = 0;
const STATE_END = 1;
const STATE_UNQUOTED = 2;
const STATE_QUOTED = 3;
const STATE_END_OF_PARAMS = 4;
const PARAM_ARRAY = 0;
const PARAM_UNQUOTED = 1;
const PARAM_QUOTED = 2;
private $function = '';
private $parameters = '';
private $params_raw = [];
/**
* Returns true if the char is allowed in the function name, false otherwise.
*
* @param string $c
*
* @return bool
*/
protected function isFunctionChar($c) {
return ($c >= 'a' && $c <= 'z');
}
/**
* Parse a trigger function and parameters and put them into $this->params_raw array.
*
* @param string $source
* @param int $pos
*/
public function parse($source, $pos = 0) {
$this->length = 0;
$this->match = '';
$this->function = '';
$this->parameters = '';
$this->params_raw = [];