postmark-php icon indicating copy to clipboard operation
postmark-php copied to clipboard

[Request] Support for PHP 8.1

Open wkhayrattee opened this issue 2 years ago • 1 comments

Hello, is there any plan to make the codebase to work with PHP 8.1 on may be v5 soon (any ETA)? (Right it's not working)

Please also note that PHP 7.4 is nearing EOL in 2 month's time (Nov 2022).

wkhayrattee avatar Sep 26 '22 19:09 wkhayrattee

Update: I just read https://github.com/ActiveCampaign/postmark-php/pull/95 I was on v4.0.2, just bumped to v4.0.4 and the suppression seems to work.

Any ETA on when we will have the codebase fully ready for PHP 8.1?

thank you

wkhayrattee avatar Sep 26 '22 19:09 wkhayrattee

This really needs to be addressed. After updating server to php 8.1 due to 7.4 EOL, I'm seeing entry after entry in the php error log showing PHP Deprecated: Return type of Postmark\Models\CaseInsensitiveArray

bmdumr avatar Feb 21 '23 19:02 bmdumr

Right, come on team - where's full support for PHP 8.1 and 8.2, now that 8.0 is imminently EOL too? We've got code that's unable to run in our PHP 8.1 application because of E_ERROR stuff being thrown because of "During inheritance of JsonSerializable: Uncaught Exception" messages relating to the WebhookConfiguration* classes.

During inheritance of JsonSerializable: Uncaught Whoops\Exception\ErrorException: Return type of Postmark\Models\Webhooks\WebhookConfigurationOpenTrigger::jsonSerialize() should either be compatible with JsonSerializable::jsonSerialize(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/wildbit/postmark-php/src/Postmark/Models/Webhooks/WebhookConfigurationOpenTrigger.php:23 Stack trace: #0 vendor/wildbit/postmark-php/src/Postmark/Models/Webhooks/WebhookConfigurationOpenTrigger.php(7)

wallacio avatar Sep 12 '23 09:09 wallacio

Sending this to postmark customer support, maybe they can direct some attention.

malles avatar Sep 12 '23 09:09 malles

I am working on bringing the library up to date. Thanks. Should have it soon.

ewood-ac avatar Oct 30 '23 19:10 ewood-ac

Thanks for showing some progress with bringing this library up to date.

Is it safe to assume that the 5.x release is a work in progress, in that regard? Whilst I see that various things are moving towards PHP 8,x, many of the type-related issues mentioned in this issue persist.

For example:

https://github.com/ActiveCampaign/postmark-php/blob/084a631b02ca7280e4eced0be6e0a7161030c444/src/Postmark/Models/CaseInsensitiveArray.php#L28

#[\ReturnTypeWillChange] has been hashed in here, and it's not necessary. The method should return void, as per ArrayAccess::offsetSet. Additionally, the method parameters need typing to be compatible with the implemented method.

I'd be happy to submit my own PR but there are already a number of old, open PRs which address some of these issues. Can someone perhaps review these, especially given that we've had a major version bump?

wallacio avatar Nov 16 '23 10:11 wallacio

Thanks for the feedback. Yes! I am continuing to work on rolling out some changes. I hope to have some updates to share soon.

ewood-ac avatar Nov 16 '23 17:11 ewood-ac

I'm going to close this issue as we should be releasing v6 soon and much of this should be addressed in that version.

ewood-ac avatar Dec 07 '23 17:12 ewood-ac