Total Complexity | 5 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | abstract class AbstractAsset |
||
6 | { |
||
7 | |||
8 | public $useLinks = true; |
||
9 | |||
10 | public $publish = true; |
||
11 | |||
12 | /** @var AbstractAsset[] */ |
||
13 | protected $assetsBefore = []; |
||
14 | |||
15 | /** @var AbstractAsset[] */ |
||
16 | protected $assetsAfter = []; |
||
17 | |||
18 | /** |
||
19 | * @return string |
||
20 | */ |
||
21 | abstract public function getBasePath(): string; |
||
22 | |||
23 | /** |
||
24 | * @return array |
||
25 | */ |
||
26 | abstract public function css(): array; |
||
27 | |||
28 | /** |
||
29 | * @return array |
||
30 | */ |
||
31 | abstract public function js(): array; |
||
32 | |||
33 | /** |
||
34 | * @return string |
||
35 | */ |
||
36 | public function getHash(): string |
||
37 | { |
||
38 | return \md5(static::class); |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return array |
||
43 | */ |
||
44 | public function getAssetsBefore(): array |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return array |
||
51 | */ |
||
52 | public function getAssetsAfter(): array |
||
53 | { |
||
54 | return $this->assetsAfter; |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * @param AbstractAsset $asset |
||
59 | */ |
||
60 | public function addAssetBefore(AbstractAsset $asset) |
||
61 | { |
||
62 | $this->assetsBefore[\get_class($asset)] = $asset; |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @param AbstractAsset $asset |
||
67 | */ |
||
68 | public function addAssetAfter(AbstractAsset $asset) |
||
71 | } |
||
72 | } |
||
73 |