1 | <?php |
||
21 | class Loader implements LoaderInterface |
||
22 | { |
||
23 | |||
24 | |||
25 | /** |
||
26 | * @var LoaderDecoratorInterface $new_loader |
||
27 | */ |
||
28 | private $new_loader; |
||
29 | |||
30 | |||
31 | /** |
||
32 | * @var LoaderDecoratorInterface $shared_loader |
||
33 | */ |
||
34 | private $shared_loader; |
||
35 | |||
36 | |||
37 | |||
38 | /** |
||
39 | * Loader constructor. |
||
40 | * |
||
41 | * @param LoaderDecoratorInterface|null $new_loader |
||
42 | * @param LoaderDecoratorInterface|null $shared_loader |
||
43 | * @throws InvalidInterfaceException |
||
44 | * @throws InvalidArgumentException |
||
45 | * @throws InvalidDataTypeException |
||
46 | */ |
||
47 | public function __construct(LoaderDecoratorInterface $new_loader, LoaderDecoratorInterface $shared_loader) |
||
52 | |||
53 | |||
54 | |||
55 | /** |
||
56 | * @return LoaderDecoratorInterface |
||
57 | */ |
||
58 | public function getNewLoader() |
||
62 | |||
63 | |||
64 | |||
65 | /** |
||
66 | * @return LoaderDecoratorInterface |
||
67 | */ |
||
68 | public function getSharedLoader() |
||
72 | |||
73 | |||
74 | |||
75 | /** |
||
76 | * @param string $fqcn |
||
77 | * @param array $arguments |
||
78 | * @param bool $shared |
||
79 | * @return mixed |
||
80 | */ |
||
81 | public function load($fqcn, $arguments = array(), $shared = true) |
||
87 | |||
88 | |||
89 | |||
90 | /** |
||
91 | * @param string $fqcn |
||
92 | * @param array $arguments |
||
93 | * @return mixed |
||
94 | */ |
||
95 | public function getNew($fqcn, $arguments = array()) |
||
99 | |||
100 | |||
101 | |||
102 | /** |
||
103 | * @param string $fqcn |
||
104 | * @param array $arguments |
||
105 | * @return mixed |
||
106 | */ |
||
107 | public function getShared($fqcn, $arguments = array()) |
||
111 | |||
112 | |||
113 | |||
114 | /** |
||
115 | * calls reset() on loaders if that method exists |
||
116 | */ |
||
117 | public function reset() |
||
122 | |||
123 | } |
||
124 | // End of file Loader.php |
||
126 |