From 293030e1b46a00bd3cb882b42b7096437dc8113f Mon Sep 17 00:00:00 2001 From: Patrick Dawkins Date: Wed, 20 May 2026 17:11:37 +0100 Subject: [PATCH 1/2] fix(legacy): cast team:project:add input to string before exploding When the user presses Enter without input to finish project selection, Symfony passes null to the validator. PHP 8 disallows null as the second argument to explode(), which caused a fatal TypeError. The existing empty(trim($id)) check below already handles the empty case correctly. Mirrors the same fix on legacy-cli's 5.x branch. Co-Authored-By: Claude Opus 4.7 (1M context) --- legacy/src/Command/Team/Project/TeamProjectAddCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy/src/Command/Team/Project/TeamProjectAddCommand.php b/legacy/src/Command/Team/Project/TeamProjectAddCommand.php index f24819971..e48f56680 100644 --- a/legacy/src/Command/Team/Project/TeamProjectAddCommand.php +++ b/legacy/src/Command/Team/Project/TeamProjectAddCommand.php @@ -122,7 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $first = true; do { $choice = $this->questionHelper->askInput($questionText, null, array_values($autocomplete), function ($value) use ($autocomplete, $first, $teamProjectIds): ?string { - [$id, ] = explode(' - ', $value); + [$id, ] = explode(' - ', (string) $value); if (empty(trim($id))) { if (!$first) { return null; From c55bd03965f8054222178a5f5abe29e1a6857371 Mon Sep 17 00:00:00 2001 From: Patrick Dawkins Date: Thu, 21 May 2026 00:29:55 +0100 Subject: [PATCH 2/2] fix(legacy): avoid undefined array key warning in team:project:add Switch [$id, ] = explode(' - ', ...) to [$id] = explode(' - ', ..., 2) so the destructuring does not read index 1 of the result. When a project has no title, the autocomplete value is just the project ID with no ' - ' separator, and explode returns a single-element array; the previous form emitted an "undefined array key 1" warning. Addresses Copilot's review comment on the parent PR. Co-Authored-By: Claude Opus 4.7 (1M context) --- legacy/src/Command/Team/Project/TeamProjectAddCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legacy/src/Command/Team/Project/TeamProjectAddCommand.php b/legacy/src/Command/Team/Project/TeamProjectAddCommand.php index e48f56680..e5d92b911 100644 --- a/legacy/src/Command/Team/Project/TeamProjectAddCommand.php +++ b/legacy/src/Command/Team/Project/TeamProjectAddCommand.php @@ -122,7 +122,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $first = true; do { $choice = $this->questionHelper->askInput($questionText, null, array_values($autocomplete), function ($value) use ($autocomplete, $first, $teamProjectIds): ?string { - [$id, ] = explode(' - ', (string) $value); + [$id] = explode(' - ', (string) $value, 2); if (empty(trim($id))) { if (!$first) { return null;