Skip to content

Commit

Permalink
Merge pull request #384 from matomo-org/php84
Browse files Browse the repository at this point in the history
[PHP 8.4] Explicitly mark nullable typed parameters
  • Loading branch information
snake14 authored Oct 21, 2024
2 parents b1769a1 + 0aa6958 commit 902a4d4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Auth/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ abstract class Base implements Auth
*/
protected $logger;

public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger ?: StaticContainer::get(LoggerInterface::class);
}
Expand Down Expand Up @@ -290,7 +290,7 @@ protected function getUserForLogin()
return $this->userForLogin;
}

protected function tryFallbackAuth($onlySuperUsers = true, Auth $auth = null)
protected function tryFallbackAuth($onlySuperUsers = true, ?Auth $auth = null)
{
if (empty($auth)) {
$auth = new \Piwik\Plugins\Login\Auth();
Expand Down
2 changes: 1 addition & 1 deletion LdapInterop/UserAccessAttributeParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class UserAccessAttributeParser
*/
private $logger;

public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger ?: StaticContainer::get(LoggerInterface::class);
}
Expand Down
2 changes: 1 addition & 1 deletion LdapInterop/UserAccessMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class UserAccessMapper
/**
* Constructor.
*/
public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger ?: StaticContainer::get(LoggerInterface::class);
}
Expand Down
2 changes: 1 addition & 1 deletion LdapInterop/UserMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class UserMapper
/**
* Constructor.
*/
public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger ?: StaticContainer::get(LoggerInterface::class);
}
Expand Down
2 changes: 1 addition & 1 deletion LdapInterop/UserSynchronizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class UserSynchronizer
*/
public static $skipPasswordConfirmation = false;

public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger ?: StaticContainer::get(LoggerInterface::class);
}
Expand Down
2 changes: 1 addition & 1 deletion Model/LdapUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class LdapUsers
/**
* Constructor.
*/
public function __construct(LoggerInterface $logger = null)
public function __construct(?LoggerInterface $logger = null)
{
$this->logger = $logger ?: StaticContainer::get(LoggerInterface::class);
}
Expand Down

0 comments on commit 902a4d4

Please sign in to comment.