Disque\Command\JScan::setArguments PHP Method

setArguments() public method

Set arguments for the command
public setArguments ( array $arguments )
$arguments array Arguments
    public function setArguments(array $arguments)
    {
        $options = [];
        if (!empty($arguments)) {
            if (!$this->checkFixedArray($arguments, count($arguments) > 1 ? 2 : 1) || !is_numeric($arguments[0]) || isset($arguments[1]) && !is_array($arguments[1])) {
                throw new InvalidCommandArgumentException($this, $arguments);
            }
            if (isset($arguments[1])) {
                $options = $arguments[1];
                $this->checkOptionsInt($options, ['count']);
                $this->checkOptionsString($options, ['queue', 'reply']);
                $this->checkOptionsArray($options, ['state']);
            }
        }
        $this->arguments = array_merge([!empty($arguments) ? (int) $arguments[0] : 0], $this->toArguments($options));
    }