1 | <?php |
||
8 | abstract class ConfigurationAbstract |
||
9 | { |
||
10 | protected $config = []; |
||
11 | |||
12 | 16 | public function __construct(array $config) |
|
17 | |||
18 | 16 | protected function validateConfig($config) |
|
19 | { |
||
20 | 16 | if (empty($config)) { |
|
21 | 2 | throw new MissingConfigException( |
|
22 | 2 | 'No config found' |
|
23 | ); |
||
24 | } |
||
25 | |||
26 | 16 | if (empty($config['type'])) { |
|
27 | 2 | throw new MissingConfigException( |
|
28 | 2 | 'No config key of "type" found in adaptor config array.' |
|
29 | ); |
||
30 | } |
||
31 | 16 | } |
|
32 | |||
33 | 2 | public function getType() |
|
37 | |||
38 | 2 | public function getOptions() |
|
42 | } |
||
43 |