1 | <?php |
||
29 | class RefreshToken |
||
30 | { |
||
31 | /** |
||
32 | * @var RefreshTokenAuthenticator |
||
33 | */ |
||
34 | private $authenticator; |
||
35 | 4 | ||
36 | /** |
||
37 | 4 | * @var RefreshTokenProvider |
|
38 | 4 | */ |
|
39 | 4 | private $provider; |
|
40 | 4 | ||
41 | 4 | /** |
|
42 | 4 | * @var AuthenticationSuccessHandlerInterface |
|
43 | 4 | */ |
|
44 | 4 | private $successHandler; |
|
45 | 4 | ||
46 | /** |
||
47 | * @var AuthenticationFailureHandlerInterface |
||
48 | */ |
||
49 | private $failureHandler; |
||
50 | |||
51 | /** |
||
52 | * @var RefreshTokenManagerInterface |
||
53 | */ |
||
54 | private $refreshTokenManager; |
||
55 | |||
56 | 3 | /** |
|
57 | * @var int |
||
58 | */ |
||
59 | 3 | private $ttl; |
|
60 | 3 | ||
61 | 3 | /** |
|
62 | 3 | * @var string |
|
63 | */ |
||
64 | private $providerKey; |
||
65 | |||
66 | 3 | /** |
|
67 | * @var bool |
||
68 | 3 | */ |
|
69 | 1 | private $ttlUpdate; |
|
70 | 1 | ||
71 | 1 | /** |
|
72 | 1 | * @var EventDispatcherInterface |
|
73 | */ |
||
74 | private $eventDispatcher; |
||
75 | 2 | ||
76 | 1 | /** |
|
77 | 1 | * RefreshToken constructor. |
|
78 | 1 | * |
|
79 | * @param RefreshTokenAuthenticator $authenticator |
||
80 | 1 | * @param RefreshTokenProvider $provider |
|
81 | 1 | * @param AuthenticationSuccessHandlerInterface $successHandler |
|
82 | * @param AuthenticationFailureHandlerInterface $failureHandler |
||
83 | 2 | * @param RefreshTokenManagerInterface $refreshTokenManager |
|
84 | * @param int $ttl |
||
85 | * @param string $providerKey |
||
86 | * @param bool $ttlUpdate |
||
87 | * @param EventDispatcherInterface $eventDispatcher |
||
88 | */ |
||
89 | public function __construct( |
||
110 | |||
111 | /** |
||
112 | * Refresh token. |
||
113 | * |
||
114 | * @param Request $request |
||
115 | * |
||
116 | * @return mixed |
||
117 | * |
||
118 | * @throws InvalidArgumentException |
||
119 | * @throws AuthenticationException |
||
120 | */ |
||
121 | public function refresh(Request $request) |
||
159 | } |
||
160 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: