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

Add (initial) support for PHP 8.4 #1631

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Conversation

jnoordsij
Copy link
Contributor

@jnoordsij jnoordsij commented Jul 9, 2024

This MR:

To make (integration) tests pass, the following changes are introduced:

  • As Laravel cannot install yet by default with PHP 8.4, per Tag for PHP 8.4 support nette/schema#68, the suggestion there is applied to ignore PHP version in platform req checks for composer. Although opting to wait for a fix of the mentioned issue is also viable, I think not checking PHP version (through composer) for integration tests is a reasonable change, as any impactful change should already be breaking the tests anyways, and still end-users will be warned when installing with composer.
  • The integration test is somewhat altered, as previously it checked for an empty logs directory. Due to deprecations in previous Laravel/Lumen versions being triggered on PHP 8.4, a log file is created by Laravel to log these messages. This MR changes the integration test to solely test functionality of the clear command, by adding a test file to the directory that should be cleared and subequently testing emptiness of that directory.

@jnoordsij
Copy link
Contributor Author

Marked as draft as PHP 8.4 for tests might be just a little too early. The deprecation fixes were moved to #1632 so they can be merged already.

@jnoordsij
Copy link
Contributor Author

@barryvdh I've slightly reworked integration tests to make sure everything passes, LMK what you think!

@barryvdh
Copy link
Owner

Why do we need to ignore the platform reqs?

@jnoordsij
Copy link
Contributor Author

As long as nette/schema does not tag 8.4 compatible (see nette/schema#68), composer won't install Laravel on 8.4+.

@barryvdh barryvdh closed this Oct 18, 2024
@barryvdh barryvdh reopened this Oct 18, 2024
@barryvdh
Copy link
Owner

I think it's tagged now, can we remove the platform reqs skipping?

php artisan debugbar:clear
- name: Check file count in logs
run: |
if [ `ls -1q "sample/storage/logs/" | wc -l` -gt 0 ];then exit 1;fi
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change exactly?

Copy link
Contributor Author

@jnoordsij jnoordsij Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure on what the intended check was doing. This check was introduced with #1118 and seems to aim to check for 'succesful completion' of the php artisan debugbar:clear command on a fresh Laravel installation. Here 'succesful' seems to be measured by "not logging any messages" (and not exiting with non-zero code).

However, this metric seems slightly off to me. In this case it was erring, because (due to maximebf/php-debugbar#687) deprecations are being logged while running the command. There are ways to work around this, e.g. suppressing deprecations with some Laravel flag.

I've here opted to rather than trying to patch the old definition of 'succes', come up with a new one that actually feature-tests the actual command. Given that the purpose of the command is cleaning json files from the storage/debugbar directory, I've now added a check to ensure the command does just this. Thus the new definition of 'succesful' is now the combination of php artisan debugbar:clear exits with code 0 and does feature-wise what it's expected to do.

@jnoordsij
Copy link
Contributor Author

I think it's tagged now, can we remove the platform reqs skipping?

Just rebased and removed the commit, although I'd still argue it might've been beneficial to have for testing either way.

@barryvdh barryvdh merged commit 3ad206c into barryvdh:master Oct 30, 2024
33 checks passed
@jnoordsij jnoordsij deleted the php8.4-support branch October 30, 2024 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants