Skip to content

Commit

Permalink
Fix PHP 8.4 depreciation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ruudk committed Jan 14, 2025
1 parent e73e243 commit 73307da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Amplitude/Amplitude.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/Amplitude/MockAmplitude.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 73307da

Please sign in to comment.