1 | <?php |
||
10 | class GenericStrategyBasedFactory |
||
11 | { |
||
12 | /** |
||
13 | * @var StrategyResolver |
||
14 | */ |
||
15 | private $strategyResolver; |
||
16 | |||
17 | /** |
||
18 | * Initiates a new AbstractStrategyBasedFactory. |
||
19 | * |
||
20 | * @param StrategyResolver $strategyResolver |
||
21 | */ |
||
22 | 2 | public function __construct(StrategyResolver $strategyResolver) |
|
26 | |||
27 | /** |
||
28 | * Makes the given class with the given strategy and config. |
||
29 | * |
||
30 | * @param string $className |
||
31 | * @param array $config |
||
32 | * @param CreationStrategyInterface|null $strategy If no strategy given the correct strategy will be resolved using |
||
33 | * StrategyResolver |
||
34 | * |
||
35 | * @see StrategyResolver::resolve() |
||
36 | * |
||
37 | * @return mixed |
||
38 | * @throws InvalidConfigException |
||
39 | */ |
||
40 | 2 | public function makeWithStrategy( |
|
52 | |||
53 | /** |
||
54 | * Validates the given config against the given strategy. |
||
55 | * |
||
56 | * @param CreationStrategyInterface $strategy |
||
57 | * @param string $className |
||
58 | * @param array $config |
||
59 | * |
||
60 | * @throws InvalidConfigException |
||
61 | */ |
||
62 | 2 | private function validateConfigParameters( |
|
78 | } |
||
79 |