File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111use Psr \Http \Message \ResponseInterface ;
1212use ZEROSPAM \Framework \SDK \Client \Exception \TooManyRetriesException ;
13+ use ZEROSPAM \Framework \SDK \Client \IOAuthClient ;
1314use ZEROSPAM \Framework \SDK \Client \Middleware \IMiddleware ;
14- use ZEROSPAM \Framework \SDK \Client \Middleware \MiddlewareClient ;
1515use ZEROSPAM \Framework \SDK \Request \Api \IRequest ;
1616
1717/**
2323 */
2424class AuthenticationMiddleware implements IMiddleware
2525{
26- use MiddlewareClient;
2726
2827 const MAX_TRIES = 3 ;
28+ /**
29+ * @var IOAuthClient
30+ */
31+ protected $ client ;
32+
33+ /**
34+ * Set the OAuth Client.
35+ *
36+ * @param IOAuthClient $client
37+ *
38+ * @return $this
39+ */
40+ public function setClient (IOAuthClient $ client ): IMiddleware
41+ {
42+ $ this ->client = $ client ;
43+
44+ return $ this ;
45+ }
46+
2947
3048 /**
3149 * Which status error code does this middleware manage.
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ interface IMiddleware
2828 *
2929 * @return $this
3030 */
31- public function setClient (IOAuthClient $ client ): IMiddleware ;
31+ public function setClient (IOAuthClient $ client ): self ;
3232
3333 /**
3434 * Which status error code does this middleware manage.
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ interface IRefreshTokenMiddleware
2121 *
2222 * @return $this
2323 */
24- public function setClient (IOAuthClient $ client ): IMiddleware ;
24+ public function setClient (IOAuthClient $ client ): self ;
2525
2626 /**
2727 * Take care of refreshing the token
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 99namespace ZEROSPAM \Framework \SDK \Client \Middleware \RefreshToken ;
1010
1111use League \OAuth2 \Client \Token \AccessToken ;
12+ use ZEROSPAM \Framework \SDK \Client \IOAuthClient ;
1213use ZEROSPAM \Framework \SDK \Client \Middleware \IRefreshTokenMiddleware ;
13- use ZEROSPAM \Framework \SDK \Client \Middleware \MiddlewareClient ;
1414
1515class RefreshTokenMiddleware implements IRefreshTokenMiddleware
1616{
1717
18- use MiddlewareClient;
18+ /**
19+ * @var IOAuthClient
20+ */
21+ protected $ client ;
22+
23+ /**
24+ * Set the OAuth Client.
25+ *
26+ * @param IOAuthClient $client
27+ *
28+ * @return $this
29+ */
30+ public function setClient (IOAuthClient $ client ): IRefreshTokenMiddleware
31+ {
32+ $ this ->client = $ client ;
33+
34+ return $ this ;
35+ }
1936
2037 /**
2138 * Take care of refreshing the token
You can’t perform that action at this time.
0 commit comments