| Total Complexity | 4 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | abstract class Driver implements DriverContract |
||
| 12 | { |
||
| 13 | protected $client; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Get driver short name. |
||
| 17 | * |
||
| 18 | * This name is used as an alias for configuration. |
||
| 19 | * |
||
| 20 | 1 | * @return string |
|
| 21 | */ |
||
| 22 | 1 | public function getShortName(): string |
|
| 23 | { |
||
| 24 | return class_basename($this); |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Initialize driver. |
||
| 29 | * |
||
| 30 | * @param Collection $parameters |
||
| 31 | * |
||
| 32 | 2 | * @return Driver|DriverContract|static |
|
| 33 | */ |
||
| 34 | public function initialize(Collection $parameters): DriverContract |
||
| 35 | 2 | { |
|
| 36 | 2 | $parameters->each(function ($value, $key) { |
|
| 37 | $this->$key = $value; |
||
| 38 | 2 | }); |
|
| 39 | |||
| 40 | $this->client = $this->createClient(); |
||
| 41 | |||
| 42 | return $this; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Get API client. |
||
| 47 | * |
||
| 48 | * @return mixed |
||
| 49 | */ |
||
| 50 | public function getClient() |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Get template compiler instance. |
||
| 57 | * |
||
| 58 | * @return TemplateCompiler|null |
||
| 59 | */ |
||
| 60 | public function getTemplateCompiler(): ?TemplateCompiler |
||
| 63 | } |
||
| 64 | } |
||
| 65 |