From e0fc9f974595b6fdc4054b8fb50fe7854ec5f9b1 Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Sun, 4 Oct 2026 09:20:51 +0100 Subject: [PATCH 1/3] Avoid null array offset in ResourceStore::getResources Co-Authored-By: Claude Fable 5.1 --- src/ResourceStore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]; } From 110a968412d1cdfd64e71f0267903e663bf56566 Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Sun, 4 Oct 2026 09:22:26 +0100 Subject: [PATCH 2/3] Cast file path to string before basename() Co-Authored-By: Claude Fable 5.1 --- src/Resources/AbstractDispatchableResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 2f7621aa02de952fcbf2c3577a7c3a3f1fcad9df Mon Sep 17 00:00:00 2001 From: Michael Sievenpiper Date: Thu, 22 Oct 2026 09:19:51 +0100 Subject: [PATCH 3/3] Avoid null array offset in GenericResourceTest --- tests/Resources/GenericResourceTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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()