public function add($cmd, $keys = null, $argv = null)
{
if ($keys !== null) {
if (is_scalar($keys)) {
$keys = [(string) $keys];
} elseif (!is_array($keys)) {
throw new \Exception("Keys must be an array or scalar");
}
}
if ($argv !== null) {
if (is_scalar($argv)) {
$argv = [(string) $argv];
} elseif (!is_array($argv)) {
throw new \Exception("Argv must be an array or scalar");
}
}
$this->cachedParams = false;
$this->stack[] = [$cmd, $keys, $argv];
}