-
-
Notifications
You must be signed in to change notification settings - Fork 614
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Depreciate injection of Request instances
Add missing notice-type
- Loading branch information
Showing
8 changed files
with
86 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
|
||
/** | ||
* Interface for event classes that are dispatched when a JWT cannot be authenticated. | ||
* | ||
* | ||
* @author Robin Chalas <[email protected]> | ||
*/ | ||
interface JWTFailureEventInterface | ||
|
@@ -19,6 +19,8 @@ interface JWTFailureEventInterface | |
public function getResponse(); | ||
|
||
/** | ||
* @deprecated since 1.7, removed in 2.0 | ||
* | ||
* @return Request | ||
*/ | ||
public function getRequest(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,24 +4,30 @@ | |
|
||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\HttpFoundation\RequestStack; | ||
use Symfony\Component\Security\Core\Exception\AuthenticationException; | ||
|
||
/** | ||
* JWTNotFoundEvent event is dispatched when a JWT cannot be found in a request | ||
* JWTNotFoundEvent event is dispatched when a JWT cannot be found in a request | ||
* covered by a firewall secured via lexik_jwt. | ||
* | ||
* @author Robin Chalas <[email protected]> | ||
*/ | ||
class JWTNotFoundEvent extends AuthenticationFailureEvent implements JWTFailureEventInterface | ||
{ | ||
/** | ||
* @param Request $request | ||
* @param Request|null $request Deprecated | ||
* @param AuthenticationException|null $exception | ||
* @param Response|null $response | ||
*/ | ||
public function __construct(Request $request, AuthenticationException $exception = null, Response $response = null) | ||
public function __construct(Request $request = null, AuthenticationException $exception = null, Response $response = null) | ||
{ | ||
$this->request = $request; | ||
if (null !== $request && class_exists(RequestStack::class)) { | ||
@trigger_error(sprintf('Passing a %s instance as first argument of %s() is deprecated since version 1.7 and will be removed in 2.0.\nInject the "@request_stack" service in your event listener instead.', Request::class, __METHOD__, PHP_EOL, RequestStack::class), E_USER_DEPRECATED); | ||
|
||
$this->request = $request; | ||
} | ||
|
||
$this->exception = $exception; | ||
$this->response = $response; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters