1 | <?php |
||
7 | class FormatterFactory |
||
8 | { |
||
9 | /** |
||
10 | * @var GenericStrategyBasedFactory |
||
11 | */ |
||
12 | private $genericFactory; |
||
13 | |||
14 | /** |
||
15 | * Initializes a new FormatterFactory. |
||
16 | * |
||
17 | * @param GenericStrategyBasedFactory $genericFactory |
||
18 | */ |
||
19 | 11 | public function __construct(GenericStrategyBasedFactory $genericFactory) |
|
23 | |||
24 | /** |
||
25 | * Makes a new Formatter with given formatter class and config. |
||
26 | * |
||
27 | * @param string $formatterClass |
||
28 | * @param array $config |
||
29 | * |
||
30 | * @return FormatterInterface |
||
31 | * @throws \InvalidArgumentException |
||
32 | * |
||
33 | * @throws \yii\base\InvalidConfigException |
||
34 | */ |
||
35 | 8 | public function make(string $formatterClass, array $config = []): FormatterInterface |
|
41 | |||
42 | /** |
||
43 | * Validates the given handler class. |
||
44 | * |
||
45 | * @param string $formatterClass |
||
46 | * |
||
47 | * @throws \InvalidArgumentException |
||
48 | */ |
||
49 | 8 | private function validateFormatter(string $formatterClass) |
|
56 | } |
||
57 |