1 | <?php namespace Atog\Api; |
||
10 | abstract class Client |
||
11 | { |
||
12 | /** |
||
13 | * Namespace for the endpoints |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $endpointNamespace; |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $domain; |
||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $config; |
||
25 | /** |
||
26 | * A array containing the cached endpoints |
||
27 | * @var array |
||
28 | */ |
||
29 | private $cachedEndpoints = []; |
||
30 | |||
31 | /** |
||
32 | * Create a new client instance. |
||
33 | * @param array $config |
||
34 | */ |
||
35 | public function __construct(array $config = []) |
||
39 | |||
40 | /** |
||
41 | * Make a GET Request to an endpoint |
||
42 | * @param $endpoint |
||
43 | * @return \Jyggen\Curl\Response |
||
44 | * @throws \Jyggen\Curl\Exception\CurlErrorException |
||
45 | * @throws \Jyggen\Curl\Exception\ProtectedOptionException |
||
46 | */ |
||
47 | public function get($endpoint) |
||
67 | |||
68 | /** |
||
69 | * Get an API endpoint |
||
70 | * @param string $endpoint |
||
71 | * @return \Atog\Api\Endpoint |
||
72 | * @throws \Atog\Api\Exceptions\InvalidEndpointException |
||
73 | */ |
||
74 | public function __get($endpoint) |
||
78 | |||
79 | /** |
||
80 | * Get an API endpoint. |
||
81 | * @param string $endpoint |
||
82 | * @return \Atog\Api\Endpoint |
||
83 | * @throws \Atog\Api\Exceptions\InvalidEndpointException |
||
84 | */ |
||
85 | public function getEndpoint($endpoint) |
||
117 | } |
||
118 |
This check looks for calls to
isset(...)
orempty()
on variables that are yet undefined. These calls will always produce the same result and can be removed.This is most likely caused by the renaming of a variable or the removal of a function/method parameter.