Completed
Push — master ( 3fe97a...7569f9 )
by cam
02:24
created
ecrire/inc/editer.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -336,8 +336,7 @@
 block discarded – undo
336 336
 		if (!autoriser('modifier', $type, (int) $id)) {
337 337
 			$contexte['editable'] = '';
338 338
 		}
339
-	}
340
-	else {
339
+	} else {
341 340
 		if (!autoriser('creer', $type, 0, null, ['id_parent' => $id_parent])) {
342 341
 			$contexte['editable'] = '';
343 342
 		}
Please login to merge, or discard this patch.
ecrire/inc/autoriser.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -267,8 +267,7 @@  discard block
 block discarded – undo
267 267
 		if ($id === '*') {
268 268
 			unset($GLOBALS['autoriser_exception'][$faire][$type]);
269 269
 			unset($autorisation[$faire][$type]);
270
-		}
271
-		else {
270
+		} else {
272 271
 			unset($GLOBALS['autoriser_exception'][$faire][$type][$id]);
273 272
 			unset($autorisation[$faire][$type][$id]);
274 273
 		}
@@ -635,8 +634,7 @@  discard block
 block discarded – undo
635 634
 function autoriser_rubrique_creer_dist(string $faire, string $type, $id, array $qui, array $opt): bool {
636 635
 	if (!empty($opt['id_parent'])) {
637 636
 		return autoriser('creerrubriquedans', 'rubrique', $opt['id_parent'], $qui);
638
-	}
639
-	else {
637
+	} else {
640 638
 		return autoriser('defaut', null, 0, $qui, $opt);
641 639
 	}
642 640
 }
@@ -791,8 +789,7 @@  discard block
 block discarded – undo
791 789
 	if (!empty($opt['id_parent'])) {
792 790
 		// creerarticledans rappelle autoriser(creer,article) sans id, donc on verifiera condition du else aussi
793 791
 		return autoriser('creerarticledans', 'rubrique', $opt['id_parent'], $qui);
794
-	}
795
-	else {
792
+	} else {
796 793
 		return (sql_countsel('spip_rubriques') > 0 && in_array($qui['statut'], ['0minirezo', '1comite']));
797 794
 	}
798 795
 }
Please login to merge, or discard this patch.
ecrire/inc/filtres.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -615,8 +615,7 @@  discard block
 block discarded – undo
615 615
 			if (!$srcSize) {
616 616
 				$poids_img[$src] = filesize($src);
617 617
 			}
618
-		}
619
-		elseif (str_contains($src, '<svg')) {
618
+		} elseif (str_contains($src, '<svg')) {
620 619
 			include_spip('inc/svg');
621 620
 			if ($attrs = svg_lire_attributs($src)) {
622 621
 				[$width, $height, $viewbox] = svg_getimagesize_from_attr($attrs);
@@ -3421,8 +3420,7 @@  discard block
 block discarded – undo
3421 3420
 	}
3422 3421
 	if (!isset($options['chemin_image']) || $options['chemin_image'] == true) {
3423 3422
 		$img_file = chemin_image($img);
3424
-	}
3425
-	else {
3423
+	} else {
3426 3424
 		if (!isset($options['variante_svg_si_possible']) || $options['variante_svg_si_possible'] == true) {
3427 3425
 			$img_file = http_img_variante_svg_si_possible($img_file);
3428 3426
 		}
@@ -3449,11 +3447,9 @@  discard block
 block discarded – undo
3449 3447
 	}
3450 3448
 	if ($alt === false) {
3451 3449
 		$alt = '';
3452
-	}
3453
-	elseif ($alt || $alt === '') {
3450
+	} elseif ($alt || $alt === '') {
3454 3451
 		$alt = " alt='" . attribut_html($alt) . "'";
3455
-	}
3456
-	else {
3452
+	} else {
3457 3453
 		$alt = " alt='" . attribut_html($title) . "'";
3458 3454
 	}
3459 3455
 	return "<img src='" . attribut_html($img_file) . "'$alt"
@@ -3580,8 +3576,7 @@  discard block
 block discarded – undo
3580 3576
 		if (!is_null($class)) {
3581 3577
 			$img = strlen((string) $class) ? inserer_attribut($img, 'class', $class) : vider_attribut($img, 'class');
3582 3578
 		}
3583
-	}
3584
-	else {
3579
+	} else {
3585 3580
 		$img = http_img_pack(
3586 3581
 			$img,
3587 3582
 			$alt,
@@ -3689,8 +3684,7 @@  discard block
 block discarded – undo
3689 3684
 		$balise_svg = inserer_attribut($balise_svg, 'aria-labelledby', $id);
3690 3685
 		$title = "<title id=\"$id\">" . entites_html($alt) . "</title>\n";
3691 3686
 		$balise_svg .= $title;
3692
-	}
3693
-	else {
3687
+	} else {
3694 3688
 		$balise_svg = inserer_attribut($balise_svg, 'aria-hidden', 'true');
3695 3689
 	}
3696 3690
 
@@ -5081,8 +5075,7 @@  discard block
 block discarded – undo
5081 5075
 	// reduit la variabilite du nom et donc le nombre de css concatenees possibles in fine
5082 5076
 	if (isset($options['hash_on_content']) && $options['hash_on_content']) {
5083 5077
 		$hash = md5((string) ($contexte_implicite['host'] . '::' . $cache));
5084
-	}
5085
-	else {
5078
+	} else {
5086 5079
 		unset($contexte_implicite['notes']); // pas pertinent pour signaler un changeemnt de contenu pour des css/js
5087 5080
 		ksort($contexte);
5088 5081
 		$hash = md5($fond . json_encode($contexte_implicite, JSON_THROW_ON_ERROR) . json_encode($contexte, JSON_THROW_ON_ERROR) . $connect);
Please login to merge, or discard this patch.
ecrire/base/objets.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1391,8 +1391,7 @@
 block discarded – undo
1391 1391
 							'champ' 	=> $parent_methode['champ'],
1392 1392
 							'table'    => $table,
1393 1393
 						];
1394
-					}
1395
-					elseif (isset($parent_methode['champ_type'])) {
1394
+					} elseif (isset($parent_methode['champ_type'])) {
1396 1395
 						$parent = [
1397 1396
 							'objet' 	 => $ligne[$parent_methode['champ_type']],
1398 1397
 							'id_objet' 	 => (int) $ligne[$parent_methode['champ']],
Please login to merge, or discard this patch.
ecrire/action/editer_liens.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -390,8 +390,7 @@
 block discarded – undo
390 390
 			if (lien_triables($table_lien)) {
391 391
 				if (isset($qualif['rang_lien'])) {
392 392
 					$rang = $qualif['rang_lien'];
393
-				}
394
-				else {
393
+				} else {
395 394
 					$where = lien_where($primary, $id, $objet, $id_objet);
396 395
 					// si il y a deja un lien pour ce couple (avec un autre role?) on reprend le meme rang si non nul
397 396
 					if (!$rang = (int) sql_getfetsel('rang_lien', $table_lien, $where)) {
Please login to merge, or discard this patch.
ecrire/action/editer_logo.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,8 +41,7 @@
 block discarded – undo
41 41
 		if ((is_countable($logo) ? count($logo) : 0) < 6) {
42 42
 			spip_log('Supprimer ancien logo ' . json_encode($logo, JSON_THROW_ON_ERROR), 'logo');
43 43
 			spip_unlink($logo[0]);
44
-		}
45
-		elseif (
44
+		} elseif (
46 45
 			($doc = $logo[5])
47 46
 			&& isset($doc['id_document'])
48 47
 			&& ($id_document = $doc['id_document'])
Please login to merge, or discard this patch.
ecrire/public/phraser_html.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -908,8 +908,7 @@  discard block
 block discarded – undo
908 908
 			erreur_squelette($err_b, $result);
909 909
 
910 910
 			continue;
911
-		}
912
-		else {
911
+		} else {
913 912
 			$boucle = [
914 913
 				'id_boucle' => $id_boucle,
915 914
 				'id_boucle_err' => $id_boucle,
@@ -1049,8 +1048,7 @@  discard block
 block discarded – undo
1049 1048
 	// si c'est un appel pour memoriser une boucle, memorisons la
1050 1049
 	if (is_string($champ) && !empty($boucle_placeholder) && !empty($boucle)) {
1051 1050
 		$boucles_connues[$boucle_placeholder][$champ] = &$boucle;
1052
-	}
1053
-	else {
1051
+	} else {
1054 1052
 		if (!empty($champ->nom_champ) && !empty($boucles_connues[$champ->nom_champ])) {
1055 1053
 			$placeholder = $champ->nom_champ;
1056 1054
 			$id = reset($champ->param[0][1]);
@@ -1199,8 +1197,7 @@  discard block
 block discarded – undo
1199 1197
 				];
1200 1198
 				erreur_squelette($err_b, $result);
1201 1199
 				$pos_courante += strlen($fin_boucle);
1202
-			}
1203
-			else {
1200
+			} else {
1204 1201
 				// verifier une eventuelle imbrication d'une boucle homonyme
1205 1202
 				// (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur)
1206 1203
 				$search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '(';
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -368,8 +368,7 @@  discard block
 block discarded – undo
368 368
 	}
369 369
 	if (!isset($regs[2])) {
370 370
 		$niveau = _LOG_INFO;
371
-	}
372
-	else {
371
+	} else {
373 372
 		$niveau = intval($regs[2]);
374 373
 	}
375 374
 
@@ -1490,8 +1489,7 @@  discard block
 block discarded – undo
1490 1489
 	) {
1491 1490
 		if (($fsize = substr($f, 0, -6) . $m[1] . '.svg') && file_exists($fsize)) {
1492 1491
 			return $themefiles["$subdir$file"] = $fsize;
1493
-		}
1494
-		else {
1492
+		} else {
1495 1493
 			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1496 1494
 		}
1497 1495
 	}
Please login to merge, or discard this patch.
ecrire/inc/plugin.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -562,11 +562,9 @@  discard block
 block discarded – undo
562 562
 		if (!isset($msg[$p])) {
563 563
 			if (isset($resume['erreur']) && $resume['erreur']) {
564 564
 				$msg[$p] = [$resume['erreur']];
565
-			}
566
-			elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
565
+			} elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
567 566
 				$msg[$p] = [plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')];
568
-			}
569
-			elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
567
+			} elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
570 568
 				$msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
571 569
 			}
572 570
 		} else {
@@ -954,8 +952,7 @@  discard block
 block discarded – undo
954 952
 					if (is_dir(constant($dir_type) . $plug . '/squelettes/')) {
955 953
 						$chemins['public'][] = "_DIR_PLUGIN_{$prefix}.'squelettes/'";
956 954
 					}
957
-				}
958
-				else {
955
+				} else {
959 956
 					foreach ($info['chemin'] as $chemin) {
960 957
 						if (
961 958
 							!isset($chemin['version'])
@@ -1424,8 +1421,7 @@  discard block
 block discarded – undo
1424 1421
 						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1425 1422
 						  $trace,
1426 1423
 						  "\n";
1427
-					}
1428
-					else {
1424
+					} else {
1429 1425
 						include_spip('inc/filtres_boites');
1430 1426
 						echo "<div class='install-plugins svp_retour'>"
1431 1427
 							. boite_ouvrir($titre, ($ok ? 'success' : 'error'))
@@ -1462,8 +1458,7 @@  discard block
 block discarded – undo
1462 1458
 	if (file_exists($nom)) {
1463 1459
 		if (str_ends_with($nom, '.php')) {
1464 1460
 			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1465
-		}
1466
-		else {
1461
+		} else {
1467 1462
 			$fichier_tmp = $nom . '.tmp';
1468 1463
 		}
1469 1464
 		file_put_contents($fichier_tmp, $contenu);
Please login to merge, or discard this patch.