Completed
Pull Request — master (#42)
by
unknown
01:14
created
ecrire/public/compiler.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -920,8 +920,7 @@
 block discarded – undo
920 920
 			if (isset($boucles[$idb]->descr['sourcefile'])) {
921 921
 				$descr['sourcefile'] = $boucles[$idb]->descr['sourcefile'];
922 922
 			}
923
-		}
924
-		else {
923
+		} else {
925 924
 			$descr = [];
926 925
 		}
927 926
 	}
Please login to merge, or discard this patch.
ecrire/public/phraser_html.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -802,8 +802,7 @@  discard block
 block discarded – undo
802 802
 function public_compte_ligne($texte, $debut = 0, $fin = null) {
803 803
 	if (is_null($fin)) {
804 804
 		return substr_count($texte, "\n", $debut);
805
-	}
806
-	else {
805
+	} else {
807 806
 		return substr_count($texte, "\n", $debut, $fin - $debut);
808 807
 	}
809 808
 }
@@ -850,8 +849,7 @@  discard block
 block discarded – undo
850 849
 			erreur_squelette($err_b, $result);
851 850
 
852 851
 			continue;
853
-		}
854
-		else {
852
+		} else {
855 853
 			$boucle = [
856 854
 				'id_boucle' => $id_boucle,
857 855
 				'id_boucle_err' => $id_boucle,
@@ -991,8 +989,7 @@  discard block
 block discarded – undo
991 989
 	// si c'est un appel pour memoriser une boucle, memorisons la
992 990
 	if (is_string($champ) and !empty($boucle_placeholder) and !empty($boucle)) {
993 991
 		$boucles_connues[$boucle_placeholder][$champ] = &$boucle;
994
-	}
995
-	else {
992
+	} else {
996 993
 		if (!empty($champ->nom_champ) and !empty($boucles_connues[$champ->nom_champ])) {
997 994
 			$placeholder = $champ->nom_champ;
998 995
 			$id = reset($champ->param[0][1]);
@@ -1135,8 +1132,7 @@  discard block
 block discarded – undo
1135 1132
 				];
1136 1133
 				erreur_squelette($err_b, $result);
1137 1134
 				$pos_courante += strlen($fin_boucle);
1138
-			}
1139
-			else {
1135
+			} else {
1140 1136
 				// verifier une eventuelle imbrication d'une boucle homonyme
1141 1137
 				// (interdite, generera une erreur plus loin, mais permet de signaler la bonne erreur)
1142 1138
 				$search_debut_boucle = BALISE_BOUCLE . $id_boucle_search . '(';
Please login to merge, or discard this patch.
ecrire/public/criteres.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2080,8 +2080,7 @@  discard block
 block discarded – undo
2080 2080
 						// Champ joker * des iterateurs DATA qui accepte tout
2081 2081
 						if (@array_key_exists('*', $desc['field'])) {
2082 2082
 							$desc['field'][$col_vraie ? $col_vraie : $col] = ''; // on veut pas de cast INT par defaut car le type peut etre n'importe quoi dans les boucles DATA
2083
-						}
2084
-						else {
2083
+						} else {
2085 2084
 							$r = calculer_critere_infixe_externe($boucle, $crit, $op, $desc, $col, $col_alias, $table);
2086 2085
 							if (!$r) {
2087 2086
 								return '';
@@ -2124,8 +2123,7 @@  discard block
 block discarded – undo
2124 2123
 				. ((isset($r[2]) and $r[2]) ? $r[2] : ",''")
2125 2124
 				. ",'" . addslashes($type_cast_quote) . "'";
2126 2125
 			$val[0] = "sql_quote($r)";
2127
-		}
2128
-		elseif (
2126
+		} elseif (
2129 2127
 			strpos($val[0], '@@defaultcast@@') !== false
2130 2128
 			and preg_match("/'@@defaultcast@@'\s*\)\s*\z/ms", $val[0], $r)
2131 2129
 		) {
Please login to merge, or discard this patch.
ecrire/public/evaluer_page.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,12 +67,10 @@
 block discarded – undo
67 67
 			$code = trim(highlight_string($code, true));
68 68
 			erreur_squelette('L' . $erreur['line'] . ': ' . $erreur['message'] . '<br />' . $code, [$page['source'],'',$erreur['file'],'',$GLOBALS['spip_lang']]);
69 69
 			$page['texte'] = '<!-- Erreur -->';
70
-		}
71
-		else {
70
+		} else {
72 71
 			$page['texte'] = ob_get_contents();
73 72
 		}
74
-	}
75
-	catch (Exception $e) {
73
+	} catch (Exception $e) {
76 74
 		$code = $page['texte'];
77 75
 		$GLOBALS['numero_ligne_php'] = 1;
78 76
 		if (!function_exists('numerote_ligne_php')) {
Please login to merge, or discard this patch.
ecrire/public/fonctions.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -207,8 +207,7 @@  discard block
 block discarded – undo
207 207
 		$pagination['type_pagination'] = $modele;
208 208
 		if (trouver_fond('pagination_' . $modele, 'modeles')) {
209 209
 			$modele = '_' . $modele;
210
-		}
211
-		else {
210
+		} else {
212 211
 			$modele = '';
213 212
 		}
214 213
 	}
@@ -295,8 +294,7 @@  discard block
 block discarded – undo
295 294
 	if ($ids) {
296 295
 		$ids = array_column($ids, 'id_objet');
297 296
 		return implode(',', $ids);
298
-	}
299
-	else {
297
+	} else {
300 298
 		return '0';
301 299
 	}
302 300
 }
Please login to merge, or discard this patch.
ecrire/public/cacher.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
 		$rep = sous_repertoire(_DIR_CACHE, '', false, true);
59 59
 		$rep = sous_repertoire($rep, 'calcul/', false, true);
60 60
 		$rep = sous_repertoire($rep, $d, false, true);
61
-	}
62
-	else {
61
+	} else {
63 62
 		// en lecture on essaye pa de creer les repertoires, on va au plus vite
64 63
 		$rep = _DIR_CACHE . "$d/";
65 64
 	}
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
@@ -1395,8 +1395,7 @@
 block discarded – undo
1395 1395
 							'champ' 	=> $parent_methode['champ'],
1396 1396
 							'table'    => $table,
1397 1397
 						];
1398
-					}
1399
-					elseif (isset($parent_methode['champ_type'])) {
1398
+					} elseif (isset($parent_methode['champ_type'])) {
1400 1399
 						$parent = [
1401 1400
 							'objet' 	 => $ligne[$parent_methode['champ_type']],
1402 1401
 							'id_objet' 	 => intval($ligne[$parent_methode['champ']]),
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
@@ -561,11 +561,9 @@  discard block
 block discarded – undo
561 561
 		if (!isset($msg[$p])) {
562 562
 			if (isset($resume['erreur']) and $resume['erreur']) {
563 563
 				$msg[$p] = [$resume['erreur']];
564
-			}
565
-			elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
564
+			} elseif (!plugin_version_compatible($k['compatibilite'], $GLOBALS['spip_version_branche'], 'spip')) {
566 565
 				$msg[$p] = [plugin_message_incompatibilite($k['compatibilite'], $GLOBALS['spip_version_branche'], 'SPIP', 'necessite')];
567
-			}
568
-			elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
566
+			} elseif (!$msg[$p] = plugin_necessite($k['necessite'], $liste, 'necessite')) {
569 567
 				$msg[$p] = plugin_necessite($k['utilise'], $liste, 'utilise');
570 568
 			}
571 569
 		} 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']) or plugin_version_compatible(
@@ -1425,8 +1422,7 @@  discard block
 block discarded – undo
1425 1422
 						echo "\n" . ($ok ? 'OK  ' : '/!\ ') . textebrut($titre) . "\n",
1426 1423
 						  $trace,
1427 1424
 						  "\n";
1428
-					}
1429
-					else {
1425
+					} else {
1430 1426
 						include_spip('inc/filtres_boites');
1431 1427
 						echo "<div class='install-plugins svp_retour'>"
1432 1428
 							. boite_ouvrir($titre, ($ok ? 'success' : 'error'))
@@ -1463,8 +1459,7 @@  discard block
 block discarded – undo
1463 1459
 	if (file_exists($nom)) {
1464 1460
 		if (substr($nom, -4) == '.php') {
1465 1461
 			$fichier_tmp = substr($nom, 0, -4) . '.tmp.php';
1466
-		}
1467
-		else {
1462
+		} else {
1468 1463
 			$fichier_tmp = $nom . '.tmp';
1469 1464
 		}
1470 1465
 		file_put_contents($fichier_tmp, $contenu);
Please login to merge, or discard this patch.
ecrire/inc/filtres_dates.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,8 +212,7 @@
 block discarded – undo
212 212
 function heures_minutes($numdate, $forme = '') {
213 213
 	if ($forme != 'abbr') {
214 214
 		return _T('date_fmt_heures_minutes', ['h' => heures($numdate), 'm' => minutes($numdate)]);
215
-	}
216
-	else {
215
+	} else {
217 216
 		return _T('date_fmt_heures_minutes_court', ['h' => heures($numdate), 'm' => minutes($numdate)]);
218 217
 	}
219 218
 }
Please login to merge, or discard this patch.