From 73307da063422eb5a12cb3de90000db3e4375219 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Tue, 14 Jan 2025 09:26:14 +0100 Subject: [PATCH] Fix PHP 8.4 depreciation This fixes the following error: > PHP Deprecated: AmplitudeExperiment\Amplitude\Amplitude::__construct(): Implicitly marking parameter $config as nullable is deprecated, the explicit nullable type must be used instead --- src/Amplitude/Amplitude.php | 2 +- tests/Amplitude/MockAmplitude.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Amplitude/Amplitude.php b/src/Amplitude/Amplitude.php index 7746d6d..da8d45e 100644 --- a/src/Amplitude/Amplitude.php +++ b/src/Amplitude/Amplitude.php @@ -26,7 +26,7 @@ class Amplitude private LoggerInterface $logger; private AmplitudeConfig $config; - public function __construct(string $apiKey, AmplitudeConfig $config = null) + public function __construct(string $apiKey, ?AmplitudeConfig $config = null) { $this->apiKey = $apiKey; $this->config = $config ?? AmplitudeConfig::builder()->build(); diff --git a/tests/Amplitude/MockAmplitude.php b/tests/Amplitude/MockAmplitude.php index 6a0d6e3..966b6ed 100644 --- a/tests/Amplitude/MockAmplitude.php +++ b/tests/Amplitude/MockAmplitude.php @@ -9,7 +9,7 @@ class MockAmplitude extends Amplitude { - public function __construct(string $apiKey, AmplitudeConfig $config = null) + public function __construct(string $apiKey, ?AmplitudeConfig $config = null) { parent::__construct($apiKey, $config); }