Skip to content

Commit eb158cb

Browse files
committed
Updating interface method per suggestion - makes sense to me, Request is redundant
1 parent c73c32e commit eb158cb

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ private function executeGuardAuthenticator($uniqueGuardKey, GuardAuthenticatorIn
7474
$request = $event->getRequest();
7575
try {
7676
if (null !== $this->logger) {
77-
$this->logger->info('Calling getCredentialsFromRequest on guard configurator', array('firewall_key' => $this->providerKey, 'authenticator' => get_class($guardAuthenticator)));
77+
$this->logger->info('Calling getCredentials on guard configurator.', array('firewall_key' => $this->providerKey, 'authenticator' => get_class($guardAuthenticator)));
7878
}
7979

8080
// allow the authenticator to fetch authentication info from the request
81-
$credentials = $guardAuthenticator->getCredentialsFromRequest($request);
81+
$credentials = $guardAuthenticator->getCredentials($request);
8282

8383
// allow null to be returned to skip authentication
8484
if (null === $credentials) {

src/Symfony/Component/Security/Guard/GuardAuthenticatorInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ interface GuardAuthenticatorInterface extends AuthenticationEntryPointInterface
4444
*
4545
* @return mixed|null
4646
*/
47-
public function getCredentialsFromRequest(Request $request);
47+
public function getCredentials(Request $request);
4848

4949
/**
5050
* Return a UserInterface object based on the credentials OR throw
5151
* an AuthenticationException.
5252
*
53-
* The *credentials* are the return value from getCredentialsFromRequest()
53+
* The *credentials* are the return value from getCredentials()
5454
*
5555
* @param mixed $credentials
5656
* @param UserProviderInterface $userProvider

src/Symfony/Component/Security/Guard/Tests/Firewall/GuardAuthenticationListenerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testHandleSuccess()
3838
$credentials = array('username' => 'weaverryan', 'password' => 'all_your_base');
3939
$authenticator
4040
->expects($this->once())
41-
->method('getCredentialsFromRequest')
41+
->method('getCredentials')
4242
->with($this->equalTo($this->request))
4343
->will($this->returnValue($credentials));
4444

@@ -87,7 +87,7 @@ public function testHandleSuccessWithRememberMe()
8787

8888
$authenticator
8989
->expects($this->once())
90-
->method('getCredentialsFromRequest')
90+
->method('getCredentials')
9191
->with($this->equalTo($this->request))
9292
->will($this->returnValue(array('username' => 'anything_not_empty')));
9393

@@ -130,7 +130,7 @@ public function testHandleCatchesAuthenticationException()
130130
$authException = new AuthenticationException('Get outta here crazy user with a bad password!');
131131
$authenticator
132132
->expects($this->once())
133-
->method('getCredentialsFromRequest')
133+
->method('getCredentials')
134134
->will($this->throwException($authException));
135135

136136
// this is not called
@@ -162,11 +162,11 @@ public function testReturnNullToSkipAuth()
162162

163163
$authenticatorA
164164
->expects($this->once())
165-
->method('getCredentialsFromRequest')
165+
->method('getCredentials')
166166
->will($this->returnValue(null));
167167
$authenticatorB
168168
->expects($this->once())
169-
->method('getCredentialsFromRequest')
169+
->method('getCredentials')
170170
->will($this->returnValue(null));
171171

172172
// this is not called

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy