1 | <?php |
||
15 | abstract class AbstractNetAcuityDatabase implements NetAcuityDatabaseInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var Client The GuzzleHttp Client. |
||
19 | */ |
||
20 | protected $client; |
||
21 | |||
22 | /** |
||
23 | * @var array The translations array for the data set. |
||
24 | */ |
||
25 | protected $translations; |
||
26 | |||
27 | /** |
||
28 | * @var string The API User Token. |
||
29 | */ |
||
30 | protected $apiUserToken; |
||
31 | |||
32 | /** |
||
33 | * @var int The Net Acuity Database ID. |
||
34 | */ |
||
35 | protected $databaseIdentifier; |
||
36 | |||
37 | /** |
||
38 | * AbstractNetAcuityDatabase constructor. |
||
39 | * |
||
40 | * @param ClientInterface $client The injected GuzzleHttp Client. |
||
41 | * @param string $apiUserToken The Net Acuity API User Token. |
||
42 | */ |
||
43 | public function __construct( |
||
50 | |||
51 | /** |
||
52 | * @param string $ip The IP to fetch the result data set for. |
||
53 | * |
||
54 | * @return array The formatted data set. |
||
55 | * |
||
56 | * @throws Exception On failure to send a Guzzle request. |
||
57 | */ |
||
58 | public function fetch(string $ip) |
||
73 | |||
74 | /** |
||
75 | * @param ClientException $e The thrown exception for handling. |
||
76 | * |
||
77 | * @throws Exception A formatted exception masking the API User Token in the event that it becomes invalid. |
||
78 | * |
||
79 | * @return void |
||
80 | */ |
||
81 | protected function handleGuzzleException(ClientException $e) |
||
95 | |||
96 | /** |
||
97 | * Parses the response into an array using the field definition. |
||
98 | * |
||
99 | * @param array $response The response from NetAcuity. |
||
100 | * |
||
101 | * @return array The response where the keys are from $fields and the values are from the $response. |
||
102 | */ |
||
103 | protected function parseBody(array $response) |
||
112 | |||
113 | /** |
||
114 | * @param string $userToken Net Acuity API User Token. |
||
115 | * @param string $ip The IP to be referenced in the lookup. |
||
116 | * |
||
117 | * @return string The formatted url query string. |
||
118 | */ |
||
119 | protected function buildQuery(string $userToken, string $ip) : string |
||
124 | } |
||
125 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a given class or a super-class is assigned to a property that is type hinted more strictly.
Either this assignment is in error or an instanceof check should be added for that assignment.