/** * @param string $providerId The name/ID of this provider * @param array|ProviderConfigLike $config * * @throws \DreamFactory\Oasys\Exceptions\OasysConfigurationException * @throws \InvalidArgumentException * @return \DreamFactory\Oasys\Providers\BaseProvider */ public function __construct($providerId, $config = null) { $this->_providerId = $providerId; if (empty($this->_config) && (null === $config || !$config instanceof BaseProviderConfig)) { $this->_config = BaseProviderConfig::createFromTemplate($this->_providerId, $config); } if (empty($this->_providerId)) { throw new \InvalidArgumentException('No provider ID specified.'); } $this->init(); // By this point, $_config is required. if (empty($this->_config)) { throw new OasysConfigurationException('No configuration was specified or set.'); } }