public function setCommandTimeout($commandTimeout)
    {
        if ($commandTimeout !== null && ! is_numeric($commandTimeout)) {
            throw new InvalidArgumentException('Timeout must be an integer.');
        }

        if (is_string($commandTimeout)) {
            $commandTimeout = (int) $commandTimeout;
        }

        $this->commandTimeout = $commandTimeout;

        return $this;
    }