Skip to content

Commit 287e21a

Browse files
Use ??= more
1 parent fc8568d commit 287e21a

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Security/LdapUserProvider.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,8 @@ class LdapUserProvider implements UserProviderInterface, PasswordUpgraderInterfa
4545

4646
public function __construct(LdapInterface $ldap, string $baseDn, string $searchDn = null, #[\SensitiveParameter] string $searchPassword = null, array $defaultRoles = [], string $uidKey = null, string $filter = null, string $passwordAttribute = null, array $extraFields = [])
4747
{
48-
if (null === $uidKey) {
49-
$uidKey = 'sAMAccountName';
50-
}
51-
52-
if (null === $filter) {
53-
$filter = '({uid_key}={user_identifier})';
54-
}
48+
$uidKey ??= 'sAMAccountName';
49+
$filter ??= '({uid_key}={user_identifier})';
5550

5651
$this->ldap = $ldap;
5752
$this->baseDn = $baseDn;

0 commit comments

Comments
 (0)