mirror of
https://github.com/beestat/app.git
synced 2025-05-24 02:14:03 -04:00
Minor changes for PHP8
This commit is contained in:
parent
5942b04ca9
commit
d7146e23ab
@ -71,7 +71,7 @@ class address extends cora\crud {
|
||||
'smarty_streets',
|
||||
'smarty_streets_api',
|
||||
[
|
||||
'street' => $address_string,
|
||||
'address_string' => $address_string,
|
||||
'country' => $country
|
||||
]
|
||||
);
|
||||
|
@ -355,6 +355,7 @@ final class database extends \mysqli {
|
||||
* @return mixed The result directly from $mysqli->query.
|
||||
*/
|
||||
public function query($query, $resultmode = null) {
|
||||
// public function query($query, $result_mode = \MYSQLI_STORE_RESULT): \mysqli_result|bool {
|
||||
// If this was an insert, update or delete, start a transaction
|
||||
$query_type = substr(trim($query), 0, 6);
|
||||
if(
|
||||
@ -518,7 +519,7 @@ final class database extends \mysqli {
|
||||
}
|
||||
}
|
||||
foreach($json_fields as $json_field) {
|
||||
$row[$json_field] = json_decode($row[$json_field], true);
|
||||
$row[$json_field] = $row[$json_field] === null ? null : json_decode($row[$json_field], true);
|
||||
}
|
||||
|
||||
|
||||
|
@ -302,7 +302,7 @@ final class request {
|
||||
'user_id' => $session->get_user_id(),
|
||||
'api_user_id' => $this->api_user['api_user_id'],
|
||||
'ip_address' => ip2long($_SERVER['REMOTE_ADDR']),
|
||||
'timestamp' => date('Y-m-d H:i:s', $this->begin_timestamp),
|
||||
'timestamp' => date('Y-m-d H:i:s', intval($this->begin_timestamp)),
|
||||
'request' => $this->request,
|
||||
'response' => $this->response,
|
||||
'error_code' => $this->response['data']['error_code'],
|
||||
@ -320,7 +320,7 @@ final class request {
|
||||
'user_id' => $session->get_user_id(),
|
||||
'api_user_id' => $this->api_user['api_user_id'],
|
||||
'ip_address' => ip2long($_SERVER['REMOTE_ADDR']),
|
||||
'timestamp' => date('Y-m-d H:i:s', $this->begin_timestamp),
|
||||
'timestamp' => date('Y-m-d H:i:s', intval($this->begin_timestamp)),
|
||||
'request' => $this->request,
|
||||
'response' => ($user['debug'] === true) ? $this->response : null,
|
||||
'total_time' => $this->total_time,
|
||||
@ -522,7 +522,12 @@ final class request {
|
||||
|
||||
// Send data to Sentry for error logging.
|
||||
// https://docs.sentry.io/development/sdk-dev/event-payloads/
|
||||
$api_user_id = $this->api_user['api_user_id'];
|
||||
if($this->api_user !== null) {
|
||||
$api_user_id = $this->api_user['api_user_id'];
|
||||
} else {
|
||||
$api_user_id = null;
|
||||
}
|
||||
|
||||
if (
|
||||
$reportable === true &&
|
||||
$setting->get('sentry_key') !== null &&
|
||||
|
@ -195,7 +195,7 @@ class runtime extends cora\api {
|
||||
'Y-m-d H:i:s',
|
||||
max(
|
||||
$sync_end,
|
||||
strtotime($thermostat['sync_end'])
|
||||
$thermostat['sync_end'] === null ? null : strtotime($thermostat['sync_end'])
|
||||
)
|
||||
)
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user