public function __call($commandName, $arguments) { if (count($arguments) > 1) { throw new InvalidArgumentException("At most 1 argument can be passed."); } if ($arguments === array()) { $jsonParameters = NULL; } else { $jsonParameters = $arguments[0]; } $response = $this->driver->execute($this->newCommand($commandName, $jsonParameters)); return $response->getValue(); }
public function __call($commandName, $arguments) { $jsonParameters = $this->extractJsonParameters($arguments); $response = $this->driver->execute($this->newCommand($commandName, $jsonParameters)); return $response->getValue(); }