Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 66778ad

Browse files
committed
Fixed deprecation warnings about passing null as parameter
1 parent e56d947 commit 66778ad

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Core/Tests/Authentication/Provider/LdapBindAuthenticationProviderTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ public function testBindFailureShouldThrowAnException()
7070
->method('bind')
7171
->willThrowException(new ConnectionException())
7272
;
73+
$ldap->method('escape')->willReturnArgument(0);
7374
$userChecker = $this->createMock(UserCheckerInterface::class);
7475

7576
$provider = new LdapBindAuthenticationProvider($userProvider, $userChecker, 'key', $ldap);
@@ -207,6 +208,7 @@ public function testEmptyQueryResultShouldThrowAnException()
207208
->method('query')
208209
->willReturn($query)
209210
;
211+
$ldap->method('escape')->willReturnArgument(0);
210212
$userChecker = $this->createMock(UserCheckerInterface::class);
211213

212214
$provider = new LdapBindAuthenticationProvider($userProvider, $userChecker, 'key', $ldap, '{username}', true, 'elsa', 'test1234A$');

Http/Firewall/UsernamePasswordJsonAuthenticationListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationM
8282

8383
public function supports(Request $request): ?bool
8484
{
85-
if (false === strpos($request->getRequestFormat(), 'json')
86-
&& false === strpos($request->getContentType(), 'json')
85+
if (false === strpos($request->getRequestFormat() ?? '', 'json')
86+
&& false === strpos($request->getContentType() ?? '', 'json')
8787
) {
8888
return false;
8989
}

0 commit comments

Comments
 (0)