src/ApiFactory.php
public function createApiConnector(string $name, array $options = []): ApiConnector
    {
        $namespace = __NAMESPACE__ . '\\Connector';
        $class     = $namespace . '\\' . \ucfirst(\strtolower($name));

        if (\class_exists($class)) {
            return new $class($this->client, $this->requestFactory, $this->streamFactory, $this->uriFactory, $options);
        }

        // No class found, sorry!
        throw new Exception\UnknownApiConnectorException("Could not find an API object for '$name'.");
    }
public function createApiConnector(string $name, array $options = []): ApiConnector
    {
        $namespace = __NAMESPACE__ . '\\Connector';
        $class     = $namespace . '\\' . \ucfirst(\strtolower($name));

        if (\class_exists($class)) {
            return new $class($this->client, $this->requestFactory, $this->streamFactory, $this->uriFactory, $options);
        }

        // No class found, sorry!
        throw new Exception\UnknownApiConnectorException("Could not find an API object for '$name'.");
    }
public function createApiConnector ( string $ name , array $ options = [ ] ) : ApiConnector { $ namespace = __NAMESPACE__ . '\\Connector' ; $ class = $ namespace . '\\' . \ ucfirst ( \ strtolower ( $ name ) ) ; if ( \ class_exists ( $ class ) ) { return new $ class ( $ this -> client , $ this -> requestFactory , $ this -> streamFactory , $ this -> uriFactory , $ options ) ; } // No class found, sorry! throw new Exception \ UnknownApiConnectorException ( "Could not find an API object for '$name'." ) ; }
Factory method to create API connectors.

@param string $name    Name of the API connector to retrieve
@param array  $options API connector options

@return ApiConnector

@throws Exception\UnknownApiConnectorException
Factory method to create API connectors .