| 1 | <?php |
||
| 15 | final class Client |
||
| 16 | { |
||
| 17 | private $host = 'http://openapi.landev.ru'; |
||
| 18 | |||
| 19 | private $token; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Ebs constructor. |
||
| 23 | * |
||
| 24 | * @param $token |
||
| 25 | * @throws Exception |
||
| 26 | */ |
||
| 27 | 25 | public function __construct($token) |
|
| 43 | |||
| 44 | 14 | public function getResponse(array $request, array $params = []) |
|
| 62 | } |
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: