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

Support PHP 8.1 and Symfony 6.1 (limiting BC to PHP 7.2) #281

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

CRC-Mismatch
Copy link

@CRC-Mismatch CRC-Mismatch commented Jun 1, 2022

This fixes deprecations and compilation failures with Symfony 6.1 (thanks to @ruudk for their fork) and PHP 8.1, mainly revolving around Monolog's AbstractProcessingHandler::write changed signature.

It's worthy of note that:

That being said, this is basically the easy (and AFAIK the only sane) way out - dropping support for PHP 7.1. If that is not satisfying, I will try to find a way to support both PHP 7.1 and 8.1 without limiting monolog to <3.0 later this week, but I can already tell it's not going to be a quick (nor pretty) job...

If PHP 7.1 support is really a must, I would suggest keeping a separate branch with monolog's version locked and split this PR into a new major version.

The CI pass evidence (apart from the latter changes to ci.yml rearranging the matrix and reverting the branch trigger) is already available here.

@CRC-Mismatch CRC-Mismatch marked this pull request as ready for review June 1, 2022 05:18
@gabrielnoro
Copy link

Hi, I've just had the same problem... It seems that this PR was opened 5 months ago, and approved almost 4 months ago. Are there any news on when it will be merged, or if it won't?

strategy:
fail-fast: false
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
Copy link
Collaborator

Choose a reason for hiding this comment

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

not related to this PR

Copy link
Author

Choose a reason for hiding this comment

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

I've put the PHP 7.1 option back in place, so now this only adds 8.1 and switches the latest to it.

If you prefer, I already had the fix for PHP 7.1 composer support (requires updating the shivammathur/setup-php action to at least 2.18.1 and adding a new property to the matrix, just for PHP 7.1) but it will end up failing with a fatal error anyway...

Command/NotifyDeploymentCommand.php Show resolved Hide resolved
@@ -28,7 +29,10 @@ public function __construct(
parent::__construct($level, $bubble, $appName, $explodeArrays, $transactionName);
}

protected function write(array $record): void
/**
* @inheritDoc
Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove, this brings no value

Copy link
Author

Choose a reason for hiding this comment

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

PhpDoc dropped.

@@ -14,6 +14,7 @@
namespace Ekino\NewRelicBundle\Tests;

use Ekino\NewRelicBundle\EkinoNewRelicBundle;
use Exception;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not our Coding Style

Copy link
Author

Choose a reason for hiding this comment

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

👍

/**
* @throws Exception
*/
public function __serialize(): array
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔 why this change?

Copy link
Author

Choose a reason for hiding this comment

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

Not entirely sure right now (bear in mind that I did this more than 3 months ago), but AFAICR, it had something to do with something failing under Symfony 6.1

composer.json Outdated
@@ -13,15 +13,15 @@
}
],
"require": {
"php": "^7.1 | ^8.0",
"php": "^7.2 | ^8.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

not related to this PR

Choose a reason for hiding this comment

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

Bumping to 7.2 was done to be able to remove parameter type declaration from write method. Check PR description for more info :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I get that removing the support of 7.1 ease the PR (even if there are ways to workarround).
Still, this is not related to this PR.

Choose a reason for hiding this comment

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

I think it was done to make CI green. Would you prefer to remove it and let CI red for this PR?

Copy link
Author

Choose a reason for hiding this comment

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

Well, if you guys find a way to make it run under PHP 7.1 🤷‍♂️ I've tried everything I had in mind, but I couldn't find a way without locking maximum Monolog version... Keep in mind that releasing this as-is with PHP 7.1 support WILL break projects under 7.1 that depend on the bundle and don't have a locked version for it.

Copy link

@wouter-toppy wouter-toppy left a comment

Choose a reason for hiding this comment

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

Great

@exqlusive
Copy link

Any update regarding this merge request?

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.

None yet

7 participants