1 | <?php |
||
12 | class ContainerAcclimator |
||
13 | { |
||
14 | /** |
||
15 | * @var array Map of container classes to container adapter classes |
||
16 | */ |
||
17 | private $adapterMap; |
||
18 | |||
19 | /** |
||
20 | * @param array $customAdapterMap Overwrite the predefined adapter map |
||
21 | */ |
||
22 | 5 | public function __construct(array $customAdapterMap = null) |
|
26 | |||
27 | /** |
||
28 | * Registers a custom adapter for a class by mapping the fully qualified class name (FQCN) of one to the other |
||
29 | * |
||
30 | * @param string $adapterFqcn The FQCN of the adapter class |
||
31 | * @param string $adapteeFqcn The FQCN of the class being adapted |
||
32 | * |
||
33 | * @return ContainerAcclimator |
||
34 | */ |
||
35 | 1 | public function registerAdapter($adapterFqcn, $adapteeFqcn) |
|
41 | |||
42 | /** |
||
43 | * Adapts an object by wrapping it with a registered adapter class that implements an Acclimate interface |
||
44 | * |
||
45 | * @param mixed $adaptee A third-party object to be acclimated |
||
46 | * |
||
47 | * @return ContainerInterface |
||
48 | * @throws InvalidAdapterException if there is no adapter found for the provided object |
||
49 | */ |
||
50 | 4 | public function acclimate($adaptee) |
|
67 | } |
||
68 |