Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show warning regarding PHP 8.4 support #312

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ jobs:
composer install

- name: Execute lint tests with Laravel preset
if: matrix.php == '8.4'
run: PINT_IGNORE_ENV=1 ./pint --test

- name: Execute lint tests with Laravel preset
if: matrix.php != '8.4'
run: ./pint --test

- name: Execute static analysis
Expand Down
8 changes: 8 additions & 0 deletions app/Commands/DefaultCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 currently supported by PHP CS Fixer and you may encounter unexpected behavior.');
$this->warn('You can still force Pint to run 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);
Expand Down