Passed
Push — master ( 348843...0ed5cc )
by Anthony
05:19
created
core/admin/contenus/ParentTexte.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@
 block discarded – undo
16 16
 			$query = $dbc->select("titre")->from("page")->where("ID_page", "=", $parent)->get();
17 17
 
18 18
 			if ((is_array($query)) && (count($query) > 0)) {
19
-				foreach ($query as $obj) $this->parent_texte = $obj->titre;
19
+				foreach ($query as $obj) {
20
+					$this->parent_texte = $obj->titre;
21
+				}
20 22
 			}
21 23
 
22 24
 			return $this->parent_texte;
Please login to merge, or discard this patch.
core/admin/inscription/AdminInscription.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,12 +35,10 @@  discard block
 block discarded – undo
35 35
 			if ($this->getTestInt($value) === true) {
36 36
 				$this->acces_administration = $value;
37 37
 				return true;
38
-			}
39
-			else if ($this->getTestInt($value) === false) {
38
+			} else if ($this->getTestInt($value) === false) {
40 39
 				$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>";
41 40
 				return false;
42
-			}
43
-			else {
41
+			} else {
44 42
 				return true;
45 43
 			}
46 44
 
@@ -57,12 +55,10 @@  discard block
 block discarded – undo
57 55
 			if ($this->getTestInt($value) === true) {
58 56
 				$this->id_liste_droit_acces = $value;
59 57
 				return true;
60
-			}
61
-			else if ($this->getTestInt($value) === false) {
58
+			} else if ($this->getTestInt($value) === false) {
62 59
 				$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>";
63 60
 				return false;
64
-			}
65
-			else {
61
+			} else {
66 62
 				return true;
67 63
 			}
68 64
 
Please login to merge, or discard this patch.
core/App.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,11 @@  discard block
 block discarded – undo
55 55
 				$objects = scandir($url);
56 56
 				foreach ($objects as $object) {
57 57
 					if ($object != "." && $object != "..") {
58
-						if (filetype($url."/".$object) == "dir") App::supprimerDossier($url."/".$object); else unlink($url."/".$object);
58
+						if (filetype($url."/".$object) == "dir") {
59
+							App::supprimerDossier($url."/".$object);
60
+						} else {
61
+							unlink($url."/".$object);
62
+						}
59 63
 					}
60 64
 				}
61 65
 				reset($objects);
@@ -84,8 +88,7 @@  discard block
 block discarded – undo
84 88
 					'secure' => SMTP_SECURE,
85 89
 					'port' => SMTP_PORT
86 90
 				]);
87
-			}
88
-			else {
91
+			} else {
89 92
 				$mailer = new \Nette\Mail\SmtpMailer();
90 93
 			}
91 94
 
Please login to merge, or discard this patch.
core/form/support/envoyer_message.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,8 +7,7 @@
 block discarded – undo
7 7
 
8 8
 	if ($validator->getErrors() !== null) {
9 9
 		\core\HTML\flashmessage\FlashMessage::setFlash($validator->getErrors());
10
-	}
11
-	else {
10
+	} else {
12 11
 		$type = $_POST["type"];
13 12
 		$objet = $_POST['objet']." de la part de ".$_SERVER['HTTP_HOST'];
14 13
 		$demande = $_POST['demande'];
Please login to merge, or discard this patch.
core/database/Querybuilder.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,8 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 			if ($no_bind === true) {
110 110
 				$this->conditions_table[] = $champ.$cond.$champ_test." ".$closure;
111
-			}
112
-			else {
111
+			} else {
113 112
 				$this->conditions[] = $cond;
114 113
 				$this->addWhere($champ, $champ_test);
115 114
 			}
@@ -122,7 +121,9 @@  discard block
 block discarded – undo
122 121
 		 * @param string $type
123 122
 		 */
124 123
 		public function orderBy($order, $type = null) {
125
-			if ($type === null) $type = "ASC";
124
+			if ($type === null) {
125
+				$type = "ASC";
126
+			}
126 127
 
127 128
 			$this->order_by = " ORDER BY ".$order." ".$type." ";
128 129
 
Please login to merge, or discard this patch.
core/database/Database.php 1 patch
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
 			if ($query) {
56 56
 				$obj = $query->fetchAll(PDO::FETCH_OBJ);
57 57
 				return $obj;
58
-			}
59
-			else {
58
+			} else {
60 59
 				FlashMessage::setFlash("Une erreur est survenue en executant cette requette : ".$req);
61 60
 			}
62 61
 		}
@@ -86,8 +85,7 @@  discard block
 block discarded – undo
86 85
 		public function rechercherEgalite($table, $champ, $value, $id_table = null, $id = null) {
87 86
 			if ($id == null) {
88 87
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'");
89
-			}
90
-			else {
88
+			} else {
91 89
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value' AND $id_table != $id");
92 90
 			}
93 91
 
@@ -96,9 +94,10 @@  discard block
 block discarded – undo
96 94
 					$nb = $obj["nb"];
97 95
 				}
98 96
 
99
-				if ((isset($nb)) && ($nb != 0)) return true;
100
-			}
101
-			else {
97
+				if ((isset($nb)) && ($nb != 0)) {
98
+					return true;
99
+				}
100
+			} else {
102 101
 				return false;
103 102
 			}
104 103
 		}
@@ -115,8 +114,7 @@  discard block
 block discarded – undo
115 114
 
116 115
 			if ($query->rowCount() > 0) {
117 116
 				return true;
118
-			}
119
-			else {
117
+			} else {
120 118
 				return false;
121 119
 			}
122 120
 		}
Please login to merge, or discard this patch.
core/auth/Encrypt.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
 						$params = $obj->mdp_params;
29 29
 					}
30 30
 				}
31
-			}
32
-			else {
31
+			} else {
33 32
 				$params = self::$params;
34 33
 			}
35 34
 
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
 
82 81
 			if ($id_identite != null) {
83 82
 				self::setSaveParams("$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20), $id_identite);
84
-			}
85
-			else {
83
+			} else {
86 84
 				self::$params = "$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20);
87 85
 			}
88 86
 
Please login to merge, or discard this patch.
core/auth/mdp/changer_mdp.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,20 +13,17 @@
 block discarded – undo
13 13
 		if ($membre->getErreur() != "") {
14 14
 			FlashMessage::setFlash($membre->getErreur());
15 15
 			header("location:".ADMWEBROOT."configuration/mon-compte");
16
-		}
17
-		else {
16
+		} else {
18 17
 			\core\auth\Connexion::setDeconnexion(WEBROOT."administrator/login");
19 18
 			FlashMessage::setFlash("Votre mot de passe a été changé avec succès, vous pouvez vous reconnecter avec votre nouveau mot de passe", "info");
20 19
 		}
21
-	}
22
-	else {
20
+	} else {
23 21
 		$membre->setMdp($mdp, $new_mdp, $verif_new_mdp);
24 22
 
25 23
 		if ($membre->getErreur() != "") {
26 24
 			FlashMessage::setFlash($membre->getErreur());
27 25
 			header("location:index.php");
28
-		}
29
-		else {
26
+		} else {
30 27
 			\core\auth\Connexion::setDeconnexion("index.php?page=login");
31 28
 			FlashMessage::setFlash("Votre mot de passe a été changé avec succès, vous pouvez vous reconnecter avec votre nouveau mot de passe", "info");
32 29
 		}
Please login to merge, or discard this patch.
core/auth/Connexion.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@  discard block
 block discarded – undo
91 91
 			if (!isset($id)) {
92 92
 				FlashMessage::setFlash("Vos identifiants de connexions sont incorrects");
93 93
 				header("location:$page_retour_err");
94
-			}
95
-			else {
94
+			} else {
96 95
 				self::setTestParamCompte($valide, $archiver, $page_retour_err);
97 96
 
98 97
 				//si les mdp sont egaux on redirige ver esace membre sinon ver login avec un mess d'erreur
@@ -104,8 +103,7 @@  discard block
 block discarded – undo
104 103
 
105 104
 					FlashMessage::setFlash("Vous êtes maintenant connecté", "info");
106 105
 					header("location:$page_retour");
107
-				}
108
-				else {
106
+				} else {
109 107
 					FlashMessage::setFlash("Vos identifiants de connexions sont incorrects");
110 108
 					header("location:$page_retour_err");
111 109
 				}
@@ -177,7 +175,9 @@  discard block
 block discarded – undo
177 175
 			$dbc = App::getDb();
178 176
 			$query = $dbc->select("last_change_mdp")->from("identite")->where("ID_identite", "=", $id_identite)->get();
179 177
 			if ((is_array($query)) && (count($query) > 0)) {
180
-				foreach ($query as $obj) return $obj->last_change_mdp;
178
+				foreach ($query as $obj) {
179
+					return $obj->last_change_mdp;
180
+				}
181 181
 			}
182 182
 		}
183 183
 
Please login to merge, or discard this patch.