File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php declare (strict_types=1 );
2+
3+ namespace Pdsinterop \Solid \Auth \Config ;
4+
5+ use DateInterval ;
6+
7+ class Expiration
8+ {
9+ ////////////////////////////// CLASS PROPERTIES \\\\\\\\\\\\\\\\\\\\\\\\\\\\
10+
11+ /** @var string */
12+ private $ accessToken ;
13+ /** @var string */
14+ private $ authCode ;
15+ /** @var string */
16+ private $ refreshToken ;
17+
18+ //////////////////////////// GETTERS AND SETTERS \\\\\\\\\\\\\\\\\\\\\\\\\\\
19+
20+ public function forAccessToken () : DateInterval
21+ {
22+ return new DateInterval ($ this ->accessToken );
23+ }
24+
25+ public function forAuthCode () : DateInterval
26+ {
27+ return new DateInterval ($ this ->authCode );
28+ }
29+
30+ public function forRefreshToken () : DateInterval
31+ {
32+ return new DateInterval ($ this ->refreshToken );
33+ }
34+
35+ //////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
36+
37+ public function __construct (string $ accessTokenExpires , string $ authCodeExpires , string $ refreshTokenExpires )
38+ {
39+ $ this ->accessToken = $ accessTokenExpires ;
40+ $ this ->authCode = $ authCodeExpires ;
41+ $ this ->refreshToken = $ refreshTokenExpires ;
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments