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

Refactor constructors to use nullable array type hinting

Open tirgrig opened this issue 2 months ago • 2 comments

  • 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.

tirgrig avatar Oct 30 '25 19:10 tirgrig

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

sonarqubecloud[bot] avatar Oct 30 '25 19:10 sonarqubecloud[bot]

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.

franck-grenier avatar Nov 06 '25 14:11 franck-grenier

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

bhenscamp avatar Nov 28 '25 14:11 bhenscamp