1 | <?php |
||
14 | class Request |
||
15 | { |
||
16 | private $api_key; |
||
|
|||
17 | |||
18 | /** |
||
19 | * Request constructor. |
||
20 | */ |
||
21 | 4 | public function __construct() |
|
22 | { |
||
23 | 4 | $this->api_keys = array(); |
|
24 | |||
25 | 4 | } |
|
26 | |||
27 | /** |
||
28 | * @inheritdoc |
||
29 | * |
||
30 | * @param string $api_key |
||
31 | */ |
||
32 | 1 | public function setApiKey(string $api_key) |
|
33 | { |
||
34 | 1 | array_push($this->api_keys, $api_key); |
|
35 | 1 | } |
|
36 | |||
37 | /** |
||
38 | * Authenticate the request |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function authenticate() |
||
47 | |||
48 | /** |
||
49 | * Is OPTIONS request |
||
50 | * |
||
51 | * @return bool |
||
52 | */ |
||
53 | public function isOptionRequest() |
||
57 | |||
58 | /** |
||
59 | * |
||
60 | * @param string $api_key |
||
61 | * @return bool |
||
62 | */ |
||
63 | 1 | public function isValidApiKey(string $api_key) |
|
67 | |||
68 | /** |
||
69 | * Is recieved API KEY valid |
||
70 | * |
||
71 | * @return bool |
||
72 | */ |
||
73 | private function checkApiKey() |
||
77 | } |
||
78 |
This check marks private properties in classes that are never used. Those properties can be removed.