1 | <?php declare(strict_types = 1); |
||
29 | class Auth implements AuthInterface |
||
30 | { |
||
31 | /** |
||
32 | * Tmdb object |
||
33 | * @var TmdbInterface |
||
34 | */ |
||
35 | private $tmdb = null; |
||
36 | /** |
||
37 | * Logger object |
||
38 | * @var \Psr\Log\LoggerInterface |
||
39 | */ |
||
40 | protected $logger = null; |
||
41 | /** |
||
42 | * Request token |
||
43 | * @var string |
||
44 | */ |
||
45 | private $request_token = null; |
||
46 | /** |
||
47 | * Session Id |
||
48 | * @var string |
||
49 | */ |
||
50 | private $session_id = null; |
||
51 | |||
52 | /** |
||
53 | * Constructor |
||
54 | * @param TmdbInterface $tmdb |
||
55 | */ |
||
56 | 43 | public function __construct(TmdbInterface $tmdb) |
|
61 | |||
62 | /** |
||
63 | * Connect and valid request token |
||
64 | * @param string $request_token |
||
65 | * @param string|null $redirect_url Redirection url after connection (optional) |
||
66 | * @return bool |
||
67 | */ |
||
68 | 2 | public function connect(string $request_token, ?string $redirect_url = null) : bool |
|
80 | |||
81 | /** |
||
82 | * Get a new request token |
||
83 | * @return string |
||
84 | */ |
||
85 | 2 | public function getRequestToken() : string |
|
96 | |||
97 | /** |
||
98 | * Create a new session Auth |
||
99 | * @param string $request_token |
||
100 | * @return string |
||
101 | */ |
||
102 | 38 | public function createSession(string $request_token) : string |
|
112 | |||
113 | /** |
||
114 | * Magical getter |
||
115 | * @param string $name Name of the variable to get |
||
116 | * @return mixed Value of the variable getted |
||
117 | */ |
||
118 | 2 | public function __get(string $name) |
|
128 | } |
||
129 |