| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | abstract class AbstractAdapter implements AdapterInterface |
||
| 9 | { |
||
| 10 | use InstanceConfigTrait; |
||
|
|
|||
| 11 | |||
| 12 | /** |
||
| 13 | * Response of the request |
||
| 14 | * |
||
| 15 | * @var \Psr\Http\Message\ResponseInterface |
||
| 16 | */ |
||
| 17 | protected $response; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * AbstractAdapter constructor. |
||
| 21 | * |
||
| 22 | * @param string|array $config The Adapter configuration |
||
| 23 | * |
||
| 24 | * @throws \Exception |
||
| 25 | */ |
||
| 26 | 15 | public function __construct($config) |
|
| 27 | { |
||
| 28 | 15 | $this->setConfig($config); |
|
| 29 | |||
| 30 | 15 | if ($this->getConfig('api.key') === null) { |
|
| 31 | 1 | throw new \InvalidArgumentException('No API key set.'); |
|
| 32 | } |
||
| 33 | 15 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @inheritdoc |
||
| 37 | */ |
||
| 38 | abstract public function send(); |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @inheritdoc |
||
| 42 | */ |
||
| 43 | 2 | public function response() |
|
| 46 | } |
||
| 47 | } |
||
| 48 |