public function __construct($params = array())
{
if (!is_array($params)) {
throw new \InvalidArgumentException('The configuration options must be an array.');
}
if (!array_key_exists('key', $params) || empty($params['key'])) {
throw new \InvalidArgumentException('Google API key is required, please visit http://code.google.com/apis/console');
}
$this->setApiKey($params['key']);
if (array_key_exists('referer', $params)) {
$this->setReferer($params['referer']);
}
if (array_key_exists('apis', $params)) {
$this->setAPIs($params['apis']);
}
}