1 | <?php |
||
7 | class Container |
||
8 | { |
||
9 | protected $repositories = []; |
||
10 | |||
11 | /** |
||
12 | * Create a container with various repositories. |
||
13 | * |
||
14 | * @param string $name |
||
15 | * @param array $args |
||
16 | */ |
||
17 | public static function __callStatic($name, $args) |
||
27 | |||
28 | /** |
||
29 | * Creates a container with a repository for each subdirectory. |
||
30 | * |
||
31 | * @param FilesystemInterface $filesystem |
||
32 | * @param string $class |
||
33 | * |
||
34 | * @return static |
||
35 | */ |
||
36 | private static function create(FilesystemInterface $filesystem, $class) |
||
48 | |||
49 | /** |
||
50 | * Returns a repository. |
||
51 | * |
||
52 | * @param string $name |
||
53 | * |
||
54 | * @return Repository |
||
55 | */ |
||
56 | public function __get($name) |
||
64 | |||
65 | /** |
||
66 | * Adds a new repository to the container. |
||
67 | * |
||
68 | * @param string $name |
||
69 | * @param Repository $repository |
||
70 | */ |
||
71 | public function __set($name, Repository $repository) |
||
75 | } |
||
76 |