1 | <?php |
||
13 | final class Security implements Common |
||
14 | { |
||
15 | private $client; |
||
16 | |||
17 | /** |
||
18 | * Security constructor. |
||
19 | * |
||
20 | * @param Client $client |
||
21 | * @throws Exception |
||
22 | */ |
||
23 | 2 | public function __construct(Client $client) |
|
31 | |||
32 | 1 | public function getSecretKey($date) |
|
44 | |||
45 | 1 | public function getUrl($method, array $params = []) |
|
70 | |||
71 | public function getDemoUrl($type, $id) |
||
75 | |||
76 | public function getAutologinUrl($uid, $time, $fio = null, $email = null, $redirect = null) { |
||
88 | } |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: