From c77a1bdb1ca88f9facdb6a7cb4eeef6921d7c453 Mon Sep 17 00:00:00 2001 From: Julius Kiekbusch Date: Fri, 29 Nov 2024 06:45:49 +0100 Subject: [PATCH] Show warning regarding PHP 8.4 support --- app/Commands/DefaultCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Commands/DefaultCommand.php b/app/Commands/DefaultCommand.php index 4d487f12..8db5579b 100644 --- a/app/Commands/DefaultCommand.php +++ b/app/Commands/DefaultCommand.php @@ -57,6 +57,14 @@ protected function configure() */ public function handle($fixCode, $elaborateSummary) { + if (! ($_ENV['PINT_IGNORE_ENV'] ?? false) && version_compare(PHP_VERSION, '8.4.0', '>=')) { + $this->warn('PHP 8.4 is not supported yet. Please downgrade to PHP 8.3 or lower.'); + $this->warn('You can still run (though not recommended) by setting the environment variable:'); + $this->warn('PINT_IGNORE_ENV=1 vendor/bin/pint'); + + return 1; + } + [$totalFiles, $changes] = $fixCode->execute(); return $elaborateSummary->execute($totalFiles, $changes);