From 2a674611ce47e89d57656093f776f3e709dd6c55 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:28:19 +0000 Subject: [PATCH 1/5] Initial plan From 7a020d50cad98a19eab247d977b75f2569632490 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:30:45 +0000 Subject: [PATCH 2/5] Replace global variable with class property for PHP version caching Co-authored-by: aegypius <25710+aegypius@users.noreply.github.com> --- .dagger/src/PhpProject.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.dagger/src/PhpProject.php b/.dagger/src/PhpProject.php index b83e274..a47a155 100644 --- a/.dagger/src/PhpProject.php +++ b/.dagger/src/PhpProject.php @@ -20,14 +20,14 @@ #[Doc("PHP Code Quality functions")] class PhpProject { + private static string|null $version = null; + private function php( Directory $source, string $image = "php", string $variant = "cli", ): Container { - global $version; - - if (!isset($version)) { + if (!isset(self::$version)) { $output = dag() ->container() ->from("composer:2") @@ -43,7 +43,7 @@ private function php( foreach (explode(PHP_EOL, $output) as $line) { if (preg_match('/^versions\D+(?(?\d+)\.(?\d+)\.(?\d+)).*/xms', $line, $matches)) { - $version = implode('.', [ + self::$version = implode('.', [ $matches['major'], $matches['minor'], ]); @@ -54,9 +54,9 @@ private function php( return dag() ->container() - ->from(match ($version ?? false) { + ->from(match (self::$version ?? false) { false => "{$image}:{$variant}", - default => "{$image}:{$version}-{$variant}" + default => "{$image}:" . self::$version . "-{$variant}" }) ; } From 15c6b4128e70dcf9028e11df7fdfe48ab711cf2f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:31:26 +0000 Subject: [PATCH 3/5] Use string interpolation for consistency Co-authored-by: aegypius <25710+aegypius@users.noreply.github.com> --- .dagger/src/PhpProject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dagger/src/PhpProject.php b/.dagger/src/PhpProject.php index a47a155..5d1c8ea 100644 --- a/.dagger/src/PhpProject.php +++ b/.dagger/src/PhpProject.php @@ -56,7 +56,7 @@ private function php( ->container() ->from(match (self::$version ?? false) { false => "{$image}:{$variant}", - default => "{$image}:" . self::$version . "-{$variant}" + default => "{$image}:{self::$version}-{$variant}" }) ; } From 97114a50bd95e872275344ffeeb2be24be61e0cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:32:06 +0000 Subject: [PATCH 4/5] Use explicit null check instead of isset() Co-authored-by: aegypius <25710+aegypius@users.noreply.github.com> --- .dagger/src/PhpProject.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dagger/src/PhpProject.php b/.dagger/src/PhpProject.php index 5d1c8ea..6c25af9 100644 --- a/.dagger/src/PhpProject.php +++ b/.dagger/src/PhpProject.php @@ -27,7 +27,7 @@ private function php( string $image = "php", string $variant = "cli", ): Container { - if (!isset(self::$version)) { + if (self::$version === null) { $output = dag() ->container() ->from("composer:2") From 998e33ac45e43aa0334ac8aaef5f655ee0ff14aa Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:32:48 +0000 Subject: [PATCH 5/5] Use consistent null checking in match expression Co-authored-by: aegypius <25710+aegypius@users.noreply.github.com> --- .dagger/src/PhpProject.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.dagger/src/PhpProject.php b/.dagger/src/PhpProject.php index 6c25af9..fee989f 100644 --- a/.dagger/src/PhpProject.php +++ b/.dagger/src/PhpProject.php @@ -54,8 +54,8 @@ private function php( return dag() ->container() - ->from(match (self::$version ?? false) { - false => "{$image}:{$variant}", + ->from(match (self::$version) { + null => "{$image}:{$variant}", default => "{$image}:{self::$version}-{$variant}" }) ;