Completed
Push — master ( 363661...b84583 )
by cam
01:01
created
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_images_lib_mini.php 1 patch
Braces   +4 added lines, -9 removed lines patch added patch discarded remove patch
@@ -524,8 +524,7 @@  discard block
 block discarded – undo
524 524
 			process_image_svg_identite($ret);
525 525
 			$ret['creer'] = false;
526 526
 		}
527
-	}
528
-	else {
527
+	} else {
529 528
 		if (!function_exists($ret['fonction_imagecreatefrom'])) {
530 529
 			return false;
531 530
 		}
@@ -628,8 +627,7 @@  discard block
 block discarded – undo
628 627
 
629 628
 	if (isset($info['mime'])) {
630 629
 		$mime = $info['mime'];
631
-	}
632
-	else {
630
+	} else {
633 631
 		$mime = image_type_to_mime_type($info[2]);
634 632
 	}
635 633
 
@@ -1408,9 +1406,7 @@  discard block
 block discarded – undo
1408 1406
 	if ($srcWidth and $srcWidth <= $maxWidth and $srcHeight <= $maxHeight) {
1409 1407
 		$vignette = $destination . '.' . $format;
1410 1408
 		@copy($image, $vignette);
1411
-	}
1412
-
1413
-	elseif ($valeurs['format_source'] === 'svg') {
1409
+	} elseif ($valeurs['format_source'] === 'svg') {
1414 1410
 		if ($svg = svg_redimensionner($valeurs['fichier'], $destWidth, $destHeight)) {
1415 1411
 			$format_sortie = 'svg';
1416 1412
 			$vignette = $destination . '.' . $format_sortie;
@@ -1846,8 +1842,7 @@  discard block
 block discarded – undo
1846 1842
 		$date = test_espace_prive() ? ('?' . $date) : '';
1847 1843
 
1848 1844
 		return _image_ecrire_tag($image, ['src' => "$logo$date", 'width' => $destWidth, 'height' => $destHeight]);
1849
-	}
1850
-	else {
1845
+	} else {
1851 1846
 		# BMP, tiff ... les redacteurs osent tout!
1852 1847
 		return $img;
1853 1848
 	}
Please login to merge, or discard this patch.
ecrire/inc/minipres.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -193,11 +193,9 @@
 block discarded – undo
193 193
 
194 194
 		if ($statut and test_espace_prive()) {
195 195
 			$corps = bouton_action(_T('public:accueil_site'), generer_url_ecrire('accueil'));
196
-		}
197
-		elseif (!empty($_COOKIE['spip_admin'])) {
196
+		} elseif (!empty($_COOKIE['spip_admin'])) {
198 197
 			$corps = bouton_action(_T('public:lien_connecter'), generer_url_public('login'));
199
-		}
200
-		else {
198
+		} else {
201 199
 			$corps = bouton_action(_T('public:accueil_site'), $GLOBALS['meta']['adresse_site']);
202 200
 		}
203 201
 		$corps = "<div class='boutons'>$corps</div>";
Please login to merge, or discard this patch.
ecrire/inc/exporter_csv.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -173,8 +173,7 @@
 block discarded – undo
173 173
 	// sinon on ecrit directement sur stdout
174 174
 	if ($options['envoyer'] and $options['envoyer'] !== 'attachment') {
175 175
 		$fichier = 'php://output';
176
-	}
177
-	else {
176
+	} else {
178 177
 	$fichier = sous_repertoire(_DIR_CACHE, 'export') . $filename;
179 178
 	}
180 179
 
Please login to merge, or discard this patch.
ecrire/inc/svg.php 1 patch
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
 	}
64 64
 	if (is_null($maxlen)) {
65 65
 		$image = file_get_contents($fichier);
66
-	}
67
-	else {
66
+	} else {
68 67
 		$image = file_get_contents($fichier, false, null, 0, $maxlen);
69 68
 	}
70 69
 	// est-ce bien une image svg ?
@@ -190,8 +189,7 @@  discard block
 block discarded – undo
190 189
 
191 190
 	if ($start === false or $start === 'end') {
192 191
 		$svg = str_replace('</svg>', $shapes . '</svg>', $svg);
193
-	}
194
-	else {
192
+	} else {
195 193
 		$p = stripos($svg, '<svg');
196 194
 		$p = strpos($svg, '>', $p);
197 195
 		$svg = substr_replace($svg, $shapes, $p + 1, 0);
@@ -253,8 +251,7 @@  discard block
 block discarded – undo
253 251
 	if (strpos($couleur, 'rgb(') === 0) {
254 252
 		$c = explode(',', substr($couleur, 4));
255 253
 		$couleur = _couleur_dec_to_hex(intval($c[0]), intval($c[1]), intval($c[2]));
256
-	}
257
-	else {
254
+	} else {
258 255
 		$couleur = couleur_html_to_hex($couleur);
259 256
 	}
260 257
 	$couleur = '#' . ltrim($couleur, '#');
@@ -305,17 +302,14 @@  discard block
 block discarded – undo
305 302
 		and $w = svg_dimension_to_pixels($attributs['width'])
306 303
 	) {
307 304
 		$width = $w;
308
-	}
309
-	else {
305
+	} else {
310 306
 		// si on recupere la taille de la viewbox mais si la viewbox est petite on met un multiplicateur pour la taille finale
311 307
 		$width = $viewBox[2];
312 308
 		if ($width < 1) {
313 309
 			$coeff = max($coeff, 1000);
314
-		}
315
-		elseif ($width < 10) {
310
+		} elseif ($width < 10) {
316 311
 			$coeff = max($coeff, 100);
317
-		}
318
-		elseif ($width < 100) {
312
+		} elseif ($width < 100) {
319 313
 			$coeff = max($coeff, 10);
320 314
 		}
321 315
 	}
@@ -324,16 +318,13 @@  discard block
 block discarded – undo
324 318
 		and $h = svg_dimension_to_pixels($attributs['height'])
325 319
 	) {
326 320
 		$height = $h;
327
-	}
328
-	else {
321
+	} else {
329 322
 		$height = $viewBox[3];
330 323
 		if ($height < 1) {
331 324
 			$coeff = max($coeff, 1000);
332
-		}
333
-		elseif ($height < 10) {
325
+		} elseif ($height < 10) {
334 326
 			$coeff = max($coeff, 100);
335
-		}
336
-		elseif ($height < 100) {
327
+		} elseif ($height < 100) {
337 328
 			$coeff = max($coeff, 10);
338 329
 		}
339 330
 	}
@@ -475,8 +466,7 @@  discard block
 block discarded – undo
475 466
 			if (isset($attributs['viewBox'])) {
476 467
 				$viewBox = explode(' ', $attributs['viewBox']);
477 468
 				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\"/>";
478
-			}
479
-			else {
469
+			} else {
480 470
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
481 471
 			}
482 472
 			$svg = svg_insert_shapes($svg, $rect);
@@ -505,8 +495,7 @@  discard block
 block discarded – undo
505 495
 			if (isset($attributs['viewBox'])) {
506 496
 				$viewBox = explode(' ', $attributs['viewBox']);
507 497
 				$rect = '<rect x="' . $viewBox[0] . '" y="' . $viewBox[1] . '" width="' . $viewBox[2] . '" height="' . $viewBox[3] . "\" fill=\"$background_color\" opacity=\"$opacity\"/>";
508
-			}
509
-			else {
498
+			} else {
510 499
 				$rect = "<rect width=\"100%\" height=\"100%\" fill=\"$background_color\"/>";
511 500
 			}
512 501
 			$svg = svg_insert_shapes($svg, $rect, false);
@@ -627,8 +616,7 @@  discard block
 block discarded – undo
627 616
 			$x = intval($viewBox[0]) + intval($viewBox[2] / 2);
628 617
 			$mx = -$x;
629 618
 			$transform = "translate($x, 0) $transform translate($mx, 0)";
630
-		}
631
-		else {
619
+		} else {
632 620
 			$transform = 'scale(1,-1)';
633 621
 
634 622
 			$y = intval($viewBox[1]) + intval($viewBox[3] / 2);
@@ -689,8 +677,7 @@  discard block
 block discarded – undo
689 677
 			$c = array_shift($colors);
690 678
 			if (strlen($c) == 4) {
691 679
 				$short[] = $c;
692
-			}
693
-			else {
680
+			} else {
694 681
 				$long[] = $c;
695 682
 			}
696 683
 		}
Please login to merge, or discard this patch.
ecrire/inc/flock.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -341,8 +341,7 @@
 block discarded – undo
341 341
 	) {
342 342
 		if ($use_copy) {
343 343
 			@copy($fichier_tmp, $fichier);
344
-		}
345
-		else {
344
+		} else {
346 345
 			@rename($fichier_tmp, $fichier);
347 346
 		}
348 347
 		// eviter que PHP ne reserve le vieux timestamp
Please login to merge, or discard this patch.
ecrire/inc/utils.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -364,8 +364,7 @@  discard block
 block discarded – undo
364 364
 	}
365 365
 	if (!isset($regs[2])) {
366 366
 		$niveau = _LOG_INFO;
367
-	}
368
-	else {
367
+	} else {
369 368
 		$niveau = intval($regs[2]);
370 369
 	}
371 370
 
@@ -1475,8 +1474,7 @@  discard block
 block discarded – undo
1475 1474
 	) {
1476 1475
 		if ($fsize = substr($f, 0, -6) . $m[1] . '.svg' and file_exists($fsize)) {
1477 1476
 			return $themefiles["$subdir$file"] = $fsize;
1478
-		}
1479
-		else {
1477
+		} else {
1480 1478
 			return $themefiles["$subdir$file"] = "$f?" . $m[1] . 'px';
1481 1479
 		}
1482 1480
 	}
@@ -3496,8 +3494,7 @@  discard block
 block discarded – undo
3496 3494
 		if (!in_array('svg', $formats)) {
3497 3495
 			$formats[] = 'svg';
3498 3496
 		}
3499
-	}
3500
-	else {
3497
+	} else {
3501 3498
 		$formats = array_diff($formats, ['svg']);
3502 3499
 	}
3503 3500
 	return $formats;
Please login to merge, or discard this patch.
ecrire/action/editer_liens.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -398,8 +398,7 @@  discard block
 block discarded – undo
398 398
 			if (lien_triables($table_lien)) {
399 399
 				if (isset($qualif['rang_lien'])) {
400 400
 					$rang = $qualif['rang_lien'];
401
-				}
402
-				else {
401
+				} else {
403 402
 					$where = lien_where($primary, $id, $objet, $id_objet);
404 403
 					// si il y a deja un lien pour ce couple (avec un autre role?) on reprend le meme rang si non nul
405 404
 					if (!$rang = intval(sql_getfetsel('rang_lien', $table_lien, $where))) {
@@ -545,8 +544,7 @@  discard block
 block discarded – undo
545 544
 		$desc = $trouver_table($table_lien);
546 545
 		if ($desc and isset($desc['field']['rang_lien'])) {
547 546
 			$triables[$table_lien] = true;
548
-		}
549
-		else {
547
+		} else {
550 548
 			$triables[$table_lien] = false;
551 549
 		}
552 550
 	}
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 pas de creer les repertoires, on va au plus vite
64 63
 		$rep = _DIR_CACHE . "calcul/$d/";
65 64
 	}
Please login to merge, or discard this patch.