models/classes/cat/CatService.php
protected function getCatEngineClient(array $options = [])
    {
        if (!isset($options[self::OPTION_ENGINE_CLIENT])) {
            throw new \InvalidArgumentException('No API client provided. Cannot connect to endpoint.');
        }

        $client = $options[self::OPTION_ENGINE_CLIENT];
        if (is_array($client)) {
            $clientClass = isset($client['class']) ? $client['class'] : null;
            $clientOptions = isset($client['options']) ? $client['options'] : array();
            if (!is_a($clientClass, ClientInterface::class, true)) {
                throw new \InvalidArgumentException('Client has to implement ClientInterface interface.');
            }
            $client = new $clientClass($clientOptions);
        } elseif (is_object($client)) {
            if (!is_a($client, ClientInterface::class)) {
                throw new \InvalidArgumentException('Client has to implement ClientInterface interface.');
            }
        } else {
            throw new \InvalidArgumentException('Client is misconfigured.');
        }
        $this->propagate($client);
        return $client;
    }
protected function getCatEngineClient(array $options = [])
    {
        if (!isset($options[self::OPTION_ENGINE_CLIENT])) {
            throw new \InvalidArgumentException('No API client provided. Cannot connect to endpoint.');
        }

        $client = $options[self::OPTION_ENGINE_CLIENT];
        if (is_array($client)) {
            $clientClass = isset($client['class']) ? $client['class'] : null;
            $clientOptions = isset($client['options']) ? $client['options'] : array();
            if (!is_a($clientClass, ClientInterface::class, true)) {
                throw new \InvalidArgumentException('Client has to implement ClientInterface interface.');
            }
            $client = new $clientClass($clientOptions);
        } elseif (is_object($client)) {
            if (!is_a($client, ClientInterface::class)) {
                throw new \InvalidArgumentException('Client has to implement ClientInterface interface.');
            }
        } else {
            throw new \InvalidArgumentException('Client is misconfigured.');
        }
        $this->propagate($client);
        return $client;
    }
Create the client and version, based on the entry $options.

@param array $options
@throws \common_exception_InconsistentData