1 | <?php |
||
10 | abstract class Driver implements DriverContract |
||
11 | { |
||
12 | /** @var Collection */ |
||
13 | protected $parameters; |
||
14 | |||
15 | /** |
||
16 | * Get driver short name. |
||
17 | * |
||
18 | * This name is used as an alias for configuration. |
||
19 | * |
||
20 | * @return string |
||
21 | */ |
||
22 | public function getShortName(): string |
||
23 | { |
||
24 | $shortName = explode('\\', get_class($this)); |
||
25 | |||
26 | return collect($shortName)->last(); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Initialize driver. |
||
31 | * |
||
32 | * @param array $parameters |
||
33 | * |
||
34 | * @return Driver|DriverContract|static |
||
35 | */ |
||
36 | public function initialize(array $parameters): DriverContract |
||
48 | |||
49 | /** |
||
50 | * Get driver parameters. |
||
51 | * |
||
52 | * @return Collection |
||
53 | */ |
||
54 | public function getParameters(): Collection |
||
58 | } |
||
59 |