1 | <?php |
||
12 | class Js implements Extension |
||
13 | { |
||
14 | /** @var string */ |
||
15 | protected $publicDirectory; |
||
16 | |||
17 | /** @var bool */ |
||
18 | protected $defer = false; |
||
19 | |||
20 | /** @var bool */ |
||
21 | protected $async = false; |
||
22 | |||
23 | /** @var bool */ |
||
24 | protected $minify = false; |
||
25 | |||
26 | 5 | public function __construct( |
|
31 | |||
32 | public function setMinify(bool $minify): self |
||
33 | { |
||
34 | $this->minify = $minify; |
||
35 | |||
36 | return $this; |
||
37 | } |
||
38 | |||
39 | public function name(): string |
||
40 | { |
||
41 | return 'js'; |
||
42 | } |
||
43 | |||
44 | 3 | public function link(string $src): string |
|
62 | |||
63 | 1 | public function inline(string $src): string |
|
69 | |||
70 | 1 | public function defer(): Js |
|
76 | |||
77 | 1 | public function async(): Js |
|
83 | |||
84 | 5 | public function parseSource(string $src): Source |
|
106 | |||
107 | 5 | protected function saveFile(string $path, string $content): void |
|
116 | } |
||
117 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.