1 | <?php |
||
13 | abstract class Config |
||
14 | { |
||
15 | const OPTION_CLASS = 'class'; |
||
16 | |||
17 | /** @var OptionsResolver */ |
||
18 | protected $resolver; |
||
19 | /** @var array */ |
||
20 | protected $supportedClasses = []; |
||
21 | |||
22 | public function __construct() |
||
31 | |||
32 | /** |
||
33 | * @param string $className |
||
34 | * @param array $arguments |
||
35 | * @return mixed |
||
36 | */ |
||
37 | abstract protected function getObject(string $className, array $arguments); |
||
38 | |||
39 | /** |
||
40 | * @param $object |
||
41 | * @return array |
||
42 | */ |
||
43 | abstract protected function getArray($object): array; |
||
44 | |||
45 | /** |
||
46 | * @param array $config |
||
47 | * @return array |
||
48 | */ |
||
49 | protected function resolve(array $config): array |
||
53 | |||
54 | /** |
||
55 | * @param string $class |
||
56 | */ |
||
57 | protected function checkIfSupport(string $class) |
||
63 | |||
64 | /** |
||
65 | * Specifies additional options |
||
66 | * This method is called after initial OptionsResolver setup |
||
67 | * Use OptionsResolver within this method |
||
68 | * |
||
69 | * @return void |
||
70 | */ |
||
71 | abstract protected function config(); |
||
72 | |||
73 | /** |
||
74 | * @param array $config |
||
75 | * @return string |
||
76 | */ |
||
77 | protected function popClassName(array $config): string |
||
84 | } |
||
85 |