1 | <?php |
||
21 | final class BundleResourceLocator implements ResourceLocatorInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var Filesystem |
||
25 | */ |
||
26 | private $filesystem; |
||
27 | |||
28 | /** |
||
29 | * @var KernelInterface |
||
30 | */ |
||
31 | private $kernel; |
||
32 | |||
33 | /** |
||
34 | * @param Filesystem $filesystem |
||
35 | * @param KernelInterface $kernel |
||
36 | */ |
||
37 | public function __construct(Filesystem $filesystem, KernelInterface $kernel) |
||
42 | |||
43 | /** |
||
44 | * {@inheritdoc} |
||
45 | * |
||
46 | * @param string $resourcePath Eg. "@AcmeBundle/Resources/views/template.html.twig" |
||
47 | */ |
||
48 | public function locateResource(string $resourcePath, ThemeInterface $theme): string |
||
73 | |||
74 | /** |
||
75 | * @param string $resourcePath |
||
76 | */ |
||
77 | private function assertResourcePathIsValid(string $resourcePath): void |
||
91 | |||
92 | /** |
||
93 | * @param string $resourcePath |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | private function getBundleNameFromResourcePath(string $resourcePath): string |
||
101 | |||
102 | /** |
||
103 | * @param string $resourcePath |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | private function getResourceNameFromResourcePath(string $resourcePath): string |
||
111 | } |
||
112 |