1 | <?php |
||
19 | class FileSystemLocator implements LocatorInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | private $roots = []; |
||
25 | |||
26 | /** |
||
27 | * @param string[] $roots |
||
28 | */ |
||
29 | public function __construct(array $roots = array()) |
||
33 | |||
34 | /** |
||
35 | * @deprecated Since version 0.9.0, use __construct(array $roots) instead |
||
36 | * |
||
37 | * @param array[] $options |
||
38 | */ |
||
39 | public function setOptions(array $options = []) |
||
57 | |||
58 | /** |
||
59 | * @param string $path |
||
60 | * |
||
61 | * @throws NotLoadableException |
||
62 | * |
||
63 | * @return string |
||
64 | */ |
||
65 | public function locate($path) |
||
78 | |||
79 | /** |
||
80 | * @param string $path |
||
81 | * |
||
82 | * @return bool|string |
||
83 | */ |
||
84 | private function locateUsingRootPathsSearch($path) |
||
94 | |||
95 | /** |
||
96 | * @param string $path |
||
97 | * |
||
98 | * @return bool|string |
||
99 | */ |
||
100 | private function locateUsingRootPlaceholder($path) |
||
113 | |||
114 | /** |
||
115 | * @param string $root |
||
116 | * @param string $path |
||
117 | * |
||
118 | * @return string|false |
||
119 | */ |
||
120 | protected function generateAbsolutePath($root, $path) |
||
124 | |||
125 | /** |
||
126 | * @param string $root |
||
127 | * |
||
128 | * @throws InvalidArgumentException |
||
129 | * |
||
130 | * @return string |
||
131 | */ |
||
132 | private function sanitizeRootPath($root) |
||
140 | |||
141 | /** |
||
142 | * @param string $path |
||
143 | * |
||
144 | * @throws NotLoadableException |
||
145 | * |
||
146 | * @return string |
||
147 | */ |
||
148 | private function sanitizeAbsolutePath($path) |
||
159 | } |
||
160 |
If you suppress an error, we recommend checking for the error condition explicitly: