diff --git a/src/ResourceStore.php b/src/ResourceStore.php index 9ac1d22..0e6d18a 100644 --- a/src/ResourceStore.php +++ b/src/ResourceStore.php @@ -131,7 +131,7 @@ public function generateHtmlIncludes($for = self::TYPE_CSS, ?int $priority = nul public function getResources($type, ?int $priority = null, array $excludePriority = []) { - if(isset($this->_store[$type][$priority])) + if($priority !== null && isset($this->_store[$type][$priority])) { return $this->_store[$type][$priority]; } diff --git a/src/Resources/AbstractDispatchableResource.php b/src/Resources/AbstractDispatchableResource.php index 6d36b63..73e54a6 100644 --- a/src/Resources/AbstractDispatchableResource.php +++ b/src/Resources/AbstractDispatchableResource.php @@ -80,7 +80,7 @@ protected function _processContent() $this->_dispatch(); } - $file = basename($this->_filePath); + $file = basename((string)$this->_filePath); $preMinified = (strpos($file, '.min.') > 0 || strpos($file, '-min.') > 0); //Return the raw content if minification has been disabled or @do-not-minify is set diff --git a/tests/Resources/GenericResourceTest.php b/tests/Resources/GenericResourceTest.php index 7d70650..ae661f5 100644 --- a/tests/Resources/GenericResourceTest.php +++ b/tests/Resources/GenericResourceTest.php @@ -49,11 +49,11 @@ public function testResource($ext, DispatchResource $class) "woff" => "application/x-font-woff", "zip" => "application/zip", "pdf" => "application/pdf", - null => "application/octet-stream", + "" => "application/octet-stream", ]; $this->assertEquals($ext, $class->getExtension()); - $this->assertEquals($extType[$ext], $class->getContentType()); + $this->assertEquals($extType[$ext ?? ""], $class->getContentType()); } public static function resourceProvider()