Skip to content

Commit 71bbafa

Browse files
author
Artur Gafarov
committed
Reusable configuration keys
1 parent 2ce6da3 commit 71bbafa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/ElasticEmailClient/ApiConfiguration.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
class ApiConfiguration
55
{
66
const AVAILABLE_REQUEST_METHODS = ['GET', 'POST'];
7+
const API_KEY = 'apiKey';
8+
const API_URL = 'apiUrl';
79

810
/**
911
* @var string
@@ -31,8 +33,8 @@ class ApiConfiguration
3133
*/
3234
public function __construct(array $params)
3335
{
34-
$this->setApiKey($params['apiKey']);
35-
$this->setApiUrl($params['apiUrl']);
36+
$this->setApiKey($params[self::API_KEY]);
37+
$this->setApiUrl($params[self::API_URL]);
3638
}
3739

3840
/**

0 commit comments

Comments
 (0)