mailerlite-api-v2-php-sdk icon indicating copy to clipboard operation
mailerlite-api-v2-php-sdk copied to clipboard

Can't use this library with PHP 7.4 (or just 7.x)

Open contactjavas opened this issue 3 years ago • 1 comments

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 );

contactjavas avatar Jun 15 '22 11:06 contactjavas

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

arokettu avatar Jun 27 '22 09:06 arokettu

Hi,

This has been fixed a while ago. The php requirements are now ^7.1 || ^8.0

johnkelesidis avatar Apr 20 '23 13:04 johnkelesidis