Browse Source

fix: caster les variables dans `gis_post_edition()`

fix phpstan warngin Binary operation "/" between string and 1|non-empty-string results in an error
pull/46/head
b_b 2 months ago
parent
commit
a828a1bbf9
  1. 12
      gis_pipelines.php

12
gis_pipelines.php

@ -117,22 +117,22 @@ function gis_post_edition($flux) {
$latitude = $longitude = 0;
$LatDeg = explode('/', $exifs['GPSLatitude'][0]);
$intLatDeg = $LatDeg[0] / ($LatDeg[1] ? $LatDeg[1] : 1);
$intLatDeg = (float) $LatDeg[0] / (float) ($LatDeg[1] ? $LatDeg[1] : 1);
$LatMin = explode('/', $exifs['GPSLatitude'][1]);
$intLatMin = $LatMin[0] / ($LatMin[1] ? $LatMin[1] : 1);
$intLatMin = (float) $LatMin[0] / (float) ($LatMin[1] ? $LatMin[1] : 1);
$LatSec = explode('/', $exifs['GPSLatitude'][2]);
$intLatSec = $LatSec[0] / ($LatSec[1] ? $LatSec[1] : 1);
$intLatSec = (float) $LatSec[0] / (float) ($LatSec[1] ? $LatSec[1] : 1);
$LongDeg = explode('/', $exifs['GPSLongitude'][0]);
$intLongDeg = $LongDeg[0] / ($LongDeg[1] ? $LongDeg[1] : 1);
$intLongDeg = (float) $LongDeg[0] / (float) ($LongDeg[1] ? $LongDeg[1] : 1);
$LongMin = explode('/', $exifs['GPSLongitude'][1]);
$intLongMin = $LongMin[0] / ($LongMin[1] ? $LongMin[1] : 1);
$intLongMin = (float) $LongMin[0] / (float) ($LongMin[1] ? $LongMin[1] : 1);
$LongSec = explode('/', $exifs['GPSLongitude'][2]);
$intLongSec = $LongSec[0] / ($LongSec[1] ? $LongSec[1] : 1);
$intLongSec = (float) $LongSec[0] / (float) ($LongSec[1] ? $LongSec[1] : 1);
// round to 5 = approximately 1 meter accuracy
if (is_numeric($intLatDeg) && is_numeric($intLatMin) && is_numeric($intLatSec)) {

Loading…
Cancel
Save