diff --git a/Classes/Controller/PluginController.php b/Classes/Controller/PluginController.php index 0ebb2ba..8d00f71 100644 --- a/Classes/Controller/PluginController.php +++ b/Classes/Controller/PluginController.php @@ -334,7 +334,7 @@ private function extractGroup($record_ids) break; } foreach ($items as $item) { - $item = intval($item); + $item = (int) $item; $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) ->getQueryBuilderForTable($table); @@ -453,17 +453,17 @@ private function extractGroup($record_ids) case 'tx_odsosm_track': case 'tx_odsosm_vector': if ($row['min_lon']) { - $this->lons[] = floatval($row['min_lon']); - $this->lats[] = floatval($row['min_lat']); - $this->lons[] = floatval($row['max_lon']); - $this->lats[] = floatval($row['max_lat']); + $this->lons[] = (float) $row['min_lon']; + $this->lats[] = (float) $row['min_lat']; + $this->lons[] = (float) $row['max_lon']; + $this->lats[] = (float) $row['max_lat']; } else { unset($records[$table][$uid]); } break; default: - $this->lons[] = floatval($row['longitude']); - $this->lats[] = floatval($row['latitude']); + $this->lons[] = (float) $row['longitude']; + $this->lats[] = (float) $row['latitude']; break; } } @@ -628,10 +628,10 @@ public function getMap() $lon = array_sum($this->lons) / count($this->lons); $lat = array_sum($this->lats) / count($this->lats); } else { - $lon = floatval($this->config['lon'] ?? $this->config['default_lon']); - $lat = floatval($this->config['lat'] ?? $this->config['default_lat']); + $lon = (float)($this->config['lon'] ?? $this->config['default_lon']); + $lat = (float)($this->config['lat'] ?? $this->config['default_lat']); } - $zoom = intval($this->config['zoom']); + $zoom = (int)$this->config['zoom']; /* ================================================== Map diff --git a/Classes/Div.php b/Classes/Div.php index d056ac2..a30e823 100644 --- a/Classes/Div.php +++ b/Classes/Div.php @@ -185,7 +185,7 @@ public static function searchAddress(&$address, $service = 0) 'tstamp' => time(), 'cache_hit' => $row['cache_hit'] + 1, ]; - $connection->update('tx_odsosm_geocache', $set, ['uid' => intval($row['uid'])]); + $connection->update('tx_odsosm_geocache', $set, ['uid' => (int) $row['uid']]); $address['lat'] = $row['lat']; $address['lon'] = $row['lon']; @@ -429,7 +429,7 @@ public static function updateCache($address, $search = []) 'tstamp' => time(), 'service_hit' => $row['service_hit'] + 1, ]; - $connection->update('tx_odsosm_geocache', $set, ['uid' => intval($row['uid'])]); + $connection->update('tx_odsosm_geocache', $set, ['uid' => (int) $row['uid']]); } else { $set['tstamp'] = time(); $set['crdate'] = time(); diff --git a/Classes/Provider/Staticmap.php b/Classes/Provider/Staticmap.php index 5985e21..5da93c5 100644 --- a/Classes/Provider/Staticmap.php +++ b/Classes/Provider/Staticmap.php @@ -35,10 +35,10 @@ public function getMap($layers, $markers, $lon, $lat, $zoom) } // set reasonable defaults for width and height (100% and vh/vw does not work with staticmap) - if (intval($this->config['width']) <= 100) { + if ((int)$this->config['width'] <= 100) { $this->config['width'] = 640; } - if (intval($this->config['height']) <= 100) { + if ((int)$this->config['height'] <= 100) { $this->config['height'] = 480; } @@ -47,8 +47,8 @@ public function getMap($layers, $markers, $lon, $lat, $zoom) '###lon###' => $lon, '###lat###' => $lat, '###zoom###' => $zoom, - '###width###' => intval($this->config['width']), - '###height###' => intval($this->config['height']), + '###width###' => (int)$this->config['width'], + '###height###' => (int)$this->config['height'], ]; $layer = array_shift($layers); diff --git a/Classes/TceMain.php b/Classes/TceMain.php index 8a63efb..9d49ab2 100644 --- a/Classes/TceMain.php +++ b/Classes/TceMain.php @@ -291,7 +291,7 @@ public function processDatamap_postProcessFieldArray($status, $table, $id, &$fie $address[$def] = $obj->datamap[$table][$id][$field]; } } - if ($config['autocomplete'] == 2 || floatval($address['longitude'] ?? 0) == 0) { + if ($config['autocomplete'] == 2 || (float) ($address['longitude'] ?? 0) == 0) { $ll = Div::updateAddress($address); if ($ll) { // Optimize address