une passe de phpcbf avec exclusion du sniff Generic.Arrays.DisallowLongArraySyntax et sans toucher au fichier inc/iptc.php
pour référence, la commande utilisée `vendor/bin/phpcbf plugins/gis --exclude=Generic.Arrays.DisallowLongArraySyntax --ignore=lang/*,inc/iptc.php`
@ -57,7 +57,8 @@ function dms_to_dec($ref, $deg, $min, $sec) {
*/
function distance($from, $to, $miles = false) {
// On ne travaille que si on a toutes les infos
if (((is_array($from) and isset($from['lat']) and isset($from['lon'])) // Le départ est soit un tableau soit un entier
if (
((is_array($from) and isset($from['lat']) and isset($from['lon'])) // Le départ est soit un tableau soit un entier
or ($from = intval($from) and $from > 0 and $from = sql_fetsel('lat,lon', 'spip_gis', "id_gis=$from")))
and ((is_array($to) and isset($to['lat']) and isset($to['lon'])) or ($to = intval($to) and $to > 0 and $to = sql_fetsel('lat,lon', 'spip_gis', "id_gis=$to"))) // Le distant est soit un tableau soit un entier
@ -228,9 +230,9 @@ function critere_gis_dist($idb, &$boucles, $crit) {
// cf plugin notation
// $boucle->join["surnom (as) table de liaison"] = array("surnom de la table a lier", "cle primaire de la table de liaison", "identifiant a lier", "type d'objet de l'identifiant");
and ($id_document = intval($flux['args']['id_objet'])
and ($id_gis = sql_getfetsel('G.id_gis', 'spip_gis AS G LEFT JOIN spip_gis_liens AS T ON T.id_gis=G.id_gis', 'T.id_objet=' . intval($id_document) . " AND T.objet='document'")))
) {
@ -350,14 +353,18 @@ function gis_xmlrpc_server_class($flux) {
* @return array $flux
*/
function gis_formulaire_traiter($flux) {
if ($flux['args']['form'] == 'configurer_gis'
and count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), _request('layers'))) > 0) {
if (
$flux['args']['form'] == 'configurer_gis'
and count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), _request('layers'))) > 0
) {
include_spip('inc/invalideur');
purger_repertoire(_DIR_VAR . 'cache-js');
suivre_invalideur(1);
} else if ($flux['args']['form'] == 'editer_liens'
} elseif (
$flux['args']['form'] == 'editer_liens'
and isset($flux['args']['args'][0])
and $flux['args']['args'][0] == 'gis') {
and $flux['args']['args'][0] == 'gis'
) {
include_spip('inc/invalideur');
suivre_invalideur(1);
}
@ -372,4 +379,4 @@ function gis_formulaire_traiter($flux) {