Skip to content

Conversation

@tirgrig
Copy link

@tirgrig tirgrig commented Oct 30, 2025

  • Updated constructors in multiple model classes to accept a nullable array parameter.
  • Changed the type hint from array $data = null to ?array $data = null for better clarity and to allow null values explicitly.

- Updated constructors in multiple model classes to accept a nullable array parameter.
- Changed the type hint from `array $data = null` to `?array $data = null` for better clarity and to allow null values explicitly.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
79.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@franck-grenier
Copy link

Hello getbrevo people,
it would be very nice to have these changes, even in a new 1.0.3 release, since those deprecation warnings can be very annoying.

Hope you will be able to merge it rapidly.

@bhenscamp
Copy link

Hi,
What I see is, that brevo php lib must be compatible with php 5.6, so what is propose to add nullable (?) type is not possible unless php 7.1.
But maybe @tirgrig you can replace default null by an empty array, I think it could be worked.
public function __construct(array $data = [])

Hope I helped

@rommelfreddy
Copy link

rommelfreddy commented Jan 7, 2026

@bhenscamp this is not possible due there are not only issues with array-property declarations.

@getbrevo: this issue will lead into problems with PHP 8.4 and projects were deprecates are treated as exceptions. so the package is not compatible with PHP 8.4.
PHP 5.x and PHP 7.x has been marked as EOL a long time ago, so the best practise would be to drop the support for those PHP Versions.

@jonirajput @sowmyahora2001

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.

4 participants