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( |
||
51 | |||
52 | /** |
||
53 | * @param string $ip The IP to fetch the result data set for. |
||
54 | * |
||
55 | * @return array The formatted data set. |
||
56 | * |
||
57 | * @throws Exception On failure to send a Guzzle request. |
||
58 | */ |
||
59 | public function fetch(string $ip) |
||
74 | |||
75 | /** |
||
76 | * @param ClientException $e The thrown exception for handling. |
||
77 | * |
||
78 | * @throws Exception A formatted exception masking the API User Token in the event that it becomes invalid. |
||
79 | * |
||
80 | * @return void |
||
81 | */ |
||
82 | protected function _handleGuzzleException(ClientException $e) |
||
96 | |||
97 | /** |
||
98 | * Parses the response into an array using the field definition. |
||
99 | * |
||
100 | * @param array $response The response from NetAcuity. |
||
101 | * |
||
102 | * @return array The response where the keys are from $fields and the values are from the $response. |
||
103 | */ |
||
104 | protected function _parseBody(array $response) |
||
113 | |||
114 | /** |
||
115 | * @param string $userToken Net Acuity API User Token. |
||
116 | * @param string $ip The IP to be referenced in the lookup. |
||
117 | * |
||
118 | * @return string The formatted url query string. |
||
119 | */ |
||
120 | protected function _buildQuery(string $userToken, string $ip) : string |
||
125 | } |
||
126 |
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.