public function __construct($config) { // only objects that implement IConfig interface are allowed to be passed for $config if (!$config instanceof IConfig) { throw new ConfigException("Invalid type for \$config parameter, it must implement IConfig interface "); } $this->_config = $config; $connectionAdapter = $this->_config->getConnectionAdapter(); switch (strtolower($connectionAdapter)) { case Config::CONNECTION_ADAPTER_GUZZLE: $this->_adapter = new GuzzleAdapter($config); break; default: throw new ConfigException("Invalid Connection Adapter set", ConfigException::INVALID_ADAPTER); break; } }