mailerlite-api-v2-php-sdk
mailerlite-api-v2-php-sdk copied to clipboard
Can't use this library with PHP 7.4 (or just 7.x)
What is the problem?
This repo says it requires at least PHP version 7.1. But after doing fresh install of this component, the Mailerlite's dependencies require at least PHP version 8.1
Is the 7.1 requirement for this Mailerlite API still valid?
How to reproduce:
- Switch to PHP 7.x (7.4 in my use-case)
- Do fresh install of this Mailerlite API v2 PHP SDK
- Add a new subscriber to a group
Code that can be used for faster reproducing:
$mailerlite_api_key = '';
$mailerlite_group_id = '';
$mailerlite_group_api = ( new \MailerLiteApi\MailerLite( $mailerlite_api_key ) )->groups();
$mailerlite_subscriber = [
'email' => $this->email,
'fields' => [
'name' => $this->name,
],
];
$response = $mailerlite_group_api->addSubscriber( $mailerlite_group_id, $mailerlite_subscriber );
Do you run composer using 8.1 and/or use --ignore-platform-reqs?
If you run composer under PHP 8.1, try to add a platform config like so:
composer config platform.php '7.1.10'
If you use --ignore-platform-reqs then don't
Hi,
This has been fixed a while ago. The php requirements are now ^7.1 || ^8.0