Total Complexity | 6 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 57.14% |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | trait HasEntrypointLookup |
||
12 | { |
||
13 | 1 | protected function getEntrypointLookup(string $entrypointName): EntrypointLookupInterface |
|
16 | } |
||
17 | |||
18 | /** |
||
19 | * @param string $entrypointName |
||
20 | * @return bool|false |
||
21 | */ |
||
22 | public function hasEntrypoint(string $entryName, string $entrypointName = '_default') |
||
23 | { |
||
24 | try { |
||
25 | $files = $this->getEntrypointLookup($entrypointName)->getJavaScriptFiles($entryName); |
||
26 | $this->getEntrypointLookup($entrypointName)->reset(); |
||
27 | return is_array($files) && count($files); |
||
28 | } catch (\Exception $e) { |
||
29 | return false; |
||
30 | } |
||
31 | } |
||
32 | |||
33 | 1 | public function getWebpackJsFiles(string $entryName, string $entrypointName = '_default'): array |
|
34 | { |
||
35 | 1 | return $this->getEntrypointLookup($entrypointName) |
|
36 | 1 | ->getJavaScriptFiles($entryName); |
|
37 | } |
||
38 | |||
39 | 1 | public function getWebpackCssFiles(string $entryName, string $entrypointName = '_default'): array |
|
43 | } |
||
44 | } |
||
45 |