From 1566ee9a80bbae5bf0e821950c8145835a0de688 Mon Sep 17 00:00:00 2001 From: Florent Morselli Date: Sun, 1 Mar 2026 10:29:05 +0100 Subject: [PATCH] fix: install Infection via Composer to fix PHP 8.5 compatibility The Infection PHAR (0.32.6) from jakzal/phpqa is scoped with php-scoper, which does not support PHP 8.5 yet (humbug/php-scoper#1139). This causes a fatal error: `Call to undefined function Infected\array_first()` because php-scoper prefixes the PHP 8.4+ built-in function. Replace the scoped PHAR with a Composer-installed version via `composer global bin infection`, which runs unscoped and works correctly on PHP 8.5. The old PHAR symlink and file are removed to avoid conflicts. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bfea3d0..84486fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -126,7 +126,11 @@ RUN set -eux; \ symfony/css-selector:"^6.4|^7.0|^8.0" \ zenstruck/foundry:"^2.8" \ --no-scripts --no-interaction --no-suggest; \ - composer global clear-cache + composer global bin infection require \ + infection/infection:"^0.32" \ + --no-scripts --no-interaction --no-suggest; \ + composer global clear-cache; \ + rm -f /tools/infection /tools/.phive/phars/infection-*.phar # ------------------------------------------------------------ # Install standalone tools