changed arguments of the modescripptevents to strings
This commit is contained in:
@ -142,7 +142,7 @@ class Connection
|
||||
* @param bool|callable $multicall True to queue the request or false to execute it immediately
|
||||
* @return mixed
|
||||
*/
|
||||
protected function execute($methodName, $params=array(), $multicall=false)
|
||||
public function execute($methodName, $params=array(), $multicall=false)
|
||||
{
|
||||
if($multicall)
|
||||
{
|
||||
@ -2687,14 +2687,22 @@ class Connection
|
||||
function triggerModeScriptEvent($event, $params='', $multicall=false)
|
||||
{
|
||||
if(!is_string($event))
|
||||
throw new InvalidArgumentException('event = '.print_r($event, true));
|
||||
throw new InvalidArgumentException('event name must be a string: event = '.print_r($event, true));
|
||||
|
||||
if(is_string($params))
|
||||
return $this->execute(ucfirst(__FUNCTION__), array($event, $params), $multicall);
|
||||
if(is_array($params))
|
||||
|
||||
if(is_array($params)){
|
||||
foreach($params as $param){
|
||||
if(!is_string($param)){
|
||||
throw new InvalidArgumentException('argument must be a string: param = '.print_r($param, true));
|
||||
}
|
||||
}
|
||||
return $this->execute(ucfirst(__FUNCTION__).'Array', array($event, $params), $multicall);
|
||||
}
|
||||
|
||||
// else
|
||||
throw new InvalidArgumentException('params = '.print_r($params, true));
|
||||
throw new InvalidArgumentException('argument must be string or string[]: params = '.print_r($params, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user