Skip to content

Commit

Permalink
Fix BC break
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Aug 24, 2021
1 parent 242b445 commit 31d9870
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Configuration/UnleashConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ public function __construct(
private bool $metricsEnabled = true,
private array $headers = [],
private bool $autoRegistrationEnabled = true,
?Context $defaultContext = null,
private ?UnleashContextProvider $contextProvider = null,
) {
$this->contextProvider ??= new DefaultUnleashContextProvider();
if ($defaultContext !== null) {
$this->setDefaultContext($defaultContext);
}
}

public function getCache(): CacheInterface
Expand Down Expand Up @@ -179,7 +184,7 @@ public function setDefaultContext(?Context $defaultContext): self

public function getContextProvider(): UnleashContextProvider
{
$this->contextProvider ??= new DefaultUnleashContextProvider();
assert($this->contextProvider !== null);

return $this->contextProvider;
}
Expand Down

0 comments on commit 31d9870

Please sign in to comment.