Skip to content

Commit 478eb73

Browse files
author
Artur Gafarov
committed
ApiConfiguration constructor arguments are not required
1 parent 71bbafa commit 478eb73

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/ElasticEmailClient/ApiConfiguration.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ class ApiConfiguration
3131
* ApiConfiguration constructor.
3232
* @param array $params
3333
*/
34-
public function __construct(array $params)
34+
public function __construct(array $params = [])
3535
{
36-
$this->setApiKey($params[self::API_KEY]);
37-
$this->setApiUrl($params[self::API_URL]);
36+
if (isset($params[self::API_KEY])) {
37+
$this->setApiKey($params[self::API_KEY]);
38+
}
39+
if (isset($params[self::API_URL])) {
40+
$this->setApiUrl($params[self::API_URL]);
41+
}
3842
}
3943

4044
/**

0 commit comments

Comments
 (0)