1 | <?php |
||
8 | class MapsManager |
||
9 | { |
||
10 | /** @var YamlParser */ |
||
11 | protected $yamlParser; |
||
12 | /** @var array */ |
||
13 | protected $cache = []; |
||
14 | /** @var array */ |
||
15 | protected $mapsDirs = []; |
||
16 | |||
17 | /** |
||
18 | * @param YamlParser $parser |
||
19 | */ |
||
20 | 7 | public function __construct(YamlParser $parser) |
|
24 | |||
25 | /** |
||
26 | * @param string $name |
||
27 | * @param string $dir |
||
28 | * @throws Exception |
||
29 | */ |
||
30 | 6 | public function setMapDir($name, $dir) |
|
34 | |||
35 | /** |
||
36 | * @param string $name |
||
37 | * @param string $type |
||
38 | * @return array |
||
39 | * |
||
40 | * @throws ParseException |
||
41 | */ |
||
42 | 5 | public function getMap($name, $type = 'dto') |
|
55 | |||
56 | /** |
||
57 | * @param string $name |
||
58 | * @param string $type |
||
59 | * @param array $map |
||
60 | */ |
||
61 | 5 | protected function setCache($name, $type, array $map) |
|
65 | |||
66 | /** |
||
67 | * @param string $name |
||
68 | * @param string $type |
||
69 | * @return array|null |
||
70 | */ |
||
71 | 5 | protected function tryCache($name, $type) |
|
79 | |||
80 | /** |
||
81 | * @param string $path |
||
82 | * @return array |
||
83 | * @throws ParseException |
||
84 | */ |
||
85 | 5 | protected function getByPath($path) |
|
89 | } |