From c5a91cd0d000e07cfab6b527601631252ecd0a87 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Wed, 15 Jan 2025 00:58:55 +0100 Subject: [PATCH] fix: use explicit nullable type for AmplitudeConfig (#32) --- .github/workflows/test.yml | 2 +- src/Amplitude/Amplitude.php | 2 +- tests/Amplitude/MockAmplitude.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a0e3dd6..4cd4bd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.4', '8.0', '8.1', '8.2', '8.3'] + php-version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] os: [ubuntu-latest] runs-on: ${{ matrix.os }} 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); }