diff --git a/src/Directives/ScriptDirective.php b/src/Directives/ScriptDirective.php index 6b96968..f0ecc23 100644 --- a/src/Directives/ScriptDirective.php +++ b/src/Directives/ScriptDirective.php @@ -8,10 +8,9 @@ public static function handle($parameter) { $parameter = str_replace(['"', "'"], null, $parameter); $array = explode(',', $parameter); - $secure = trim(@$array[1]) == 'true' ? true : null; - $url = asset(trim($array[0]), $secure); + $url = trim($array[0]); + $defer = trim(@$array[1]) ?? null; - $defer = trim(@$array[2]) ?? null; if ($defer) { return ""; } diff --git a/src/Directives/StyleDirective.php b/src/Directives/StyleDirective.php index 0c3af8f..0acdca7 100644 --- a/src/Directives/StyleDirective.php +++ b/src/Directives/StyleDirective.php @@ -7,10 +7,7 @@ class StyleDirective implements Directive public static function handle($parameter) { $parameter = str_replace(['"', "'"], null, $parameter); - $array = explode(',', $parameter); - $secure = trim(@$array[1]) == 'true' ? true : null; - $url = asset(trim($array[0]), $secure); - return ""; + return ""; } } \ No newline at end of file diff --git a/tests/DirectivesTest.php b/tests/DirectivesTest.php index 2ca4501..9537e9a 100644 --- a/tests/DirectivesTest.php +++ b/tests/DirectivesTest.php @@ -147,16 +147,13 @@ public function testImageDirective() public function testStyleDirective() { - $this->assertEquals("", $this->compiler->compileString("@style('style.css')")); - $this->assertEquals("", $this->compiler->compileString("@style('style.css', true)")); + $this->assertEquals("", $this->compiler->compileString("@style('/css/style.css')")); } public function testScriptDirective() { - $this->assertEquals("", $this->compiler->compileString("@script('script.js', false, true)")); - $this->assertEquals("", $this->compiler->compileString("@script('script.js')")); - $this->assertEquals("", $this->compiler->compileString("@script('script.js', true)")); - $this->assertEquals("", $this->compiler->compileString("@script('script.js', true, true)")); + $this->assertEquals("", $this->compiler->compileString("@script('/js/script.js')")); + $this->assertEquals("", $this->compiler->compileString("@script('/js/script.js', true)")); } public function testConfigDirectiveStyle()