1 | <?php |
||
14 | class Resolver |
||
15 | { |
||
16 | /** |
||
17 | * @var ClassLoader |
||
18 | */ |
||
19 | private $composer; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $extensions = ['.php']; |
||
25 | |||
26 | /** |
||
27 | * Resolver constructor. |
||
28 | * |
||
29 | * @param ClassLoader $composer |
||
30 | * @param array $extensions |
||
31 | */ |
||
32 | public function __construct(ClassLoader $composer, $extensions = null) |
||
36 | |||
37 | /** |
||
38 | * Resolve a psr4 based namespace to an absolute directory |
||
39 | * |
||
40 | * @param string $namespace |
||
41 | * @return array |
||
42 | * @throws Exception |
||
43 | */ |
||
44 | public function resolveDirectory(string $namespace): array |
||
64 | |||
65 | /** |
||
66 | * @param string $namespace |
||
67 | * @param array $prefixes |
||
68 | * @return string |
||
69 | */ |
||
70 | private function findPrefix(string $namespace, array $prefixes): string |
||
84 | |||
85 | /** |
||
86 | * Convert the supplied namespace string into a standard format |
||
87 | * |
||
88 | * Example: |
||
89 | * Psr4\Prefix\ |
||
90 | * Something\ |
||
91 | * |
||
92 | * @param string $namespace |
||
93 | * @return string |
||
94 | * @throws Exception |
||
95 | */ |
||
96 | private function normalise(string $namespace): string |
||
106 | |||
107 | /** |
||
108 | * Get an absolute path for the provided namespace, based on a existing directory and its psr4 prefix |
||
109 | * |
||
110 | * @param string $namespace |
||
111 | * @param string $psr4Prefix the psr4 prefix |
||
112 | * @param string $psr4Path and it's related path |
||
113 | * @return string the absolute directory path the provided namespace, given the correct prefix and path |
||
114 | * empty string if path cant be resolved |
||
115 | */ |
||
116 | private function findAbsolutePathForPsr4(string $namespace, string $psr4Prefix, string $psr4Path): string |
||
130 | } |
||
131 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.