Passed
Push — master ( c8d4c1...097a2d )
by Anthony
05:38
created
core/auth/Inscription.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
 				if (isset($datas[$i][2])) {
24 24
 					$this->$function($datas[$i][1], $datas[$i][2]);
25
-				}
26
-				else {
25
+				} else {
27 26
 					$this->$function($datas[$i][1]);
28 27
 				}
29 28
 			}
@@ -56,8 +55,7 @@  discard block
 block discarded – undo
56 55
 		protected function getTestRequired($value) {
57 56
 			if (($value == "") || ($value == null) || (strlen($value) == 0)) {
58 57
 				return false;
59
-			}
60
-			else {
58
+			} else {
61 59
 				return true;
62 60
 			}
63 61
 		}
@@ -70,8 +68,7 @@  discard block
 block discarded – undo
70 68
 		protected function getTestLongueur($value, $longeur) {
71 69
 			if (strlen($value) > $longeur) {
72 70
 				return true;
73
-			}
74
-			else {
71
+			} else {
75 72
 				return false;
76 73
 			}
77 74
 		}
@@ -83,8 +80,7 @@  discard block
 block discarded – undo
83 80
 		protected function getTestInt($value) {
84 81
 			if (is_numeric($value)) {
85 82
 				return true;
86
-			}
87
-			else {
83
+			} else {
88 84
 				return false;
89 85
 			}
90 86
 		}
@@ -102,12 +98,10 @@  discard block
 block discarded – undo
102 98
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
103 99
 				$this->erreur .= "<li>$erreur</li>";
104 100
 				return false;
105
-			}
106
-			else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
101
+			} else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
107 102
 				$this->erreur .= "<li>$erreur_long</li>";
108 103
 				return false;
109
-			}
110
-			else {
104
+			} else {
111 105
 				$this->$varaible = $value;
112 106
 				return true;
113 107
 			}
@@ -155,8 +149,7 @@  discard block
 block discarded – undo
155 149
 		protected function setVerifRetapeMdp($value) {
156 150
 			if ($this->mdp == $value) {
157 151
 				return true;
158
-			}
159
-			else {
152
+			} else {
160 153
 				$this->erreur .= "<li>Les mots de passent ne correspondent pas</li>";
161 154
 				$this->mdp = null;
162 155
 				return false;
@@ -186,12 +179,10 @@  discard block
 block discarded – undo
186 179
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
187 180
 				$this->erreur .= "<li>Le champs E-mail ne peut pas être vide</li>";
188 181
 				return false;
189
-			}
190
-			else if (!$validator->isValid($value)) {
182
+			} else if (!$validator->isValid($value)) {
191 183
 				$this->erreur .= "<li>Le champs E-mail doit être une adresse E-mail valide</li>";
192 184
 				return false;
193
-			}
194
-			else {
185
+			} else {
195 186
 				$this->mail = $value;
196 187
 				return true;
197 188
 			}
Please login to merge, or discard this patch.
core/admin/navigation/AdminNavigation.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,20 +5,20 @@
 block discarded – undo
5 5
 	use core\HTML\flashmessage\FlashMessage;
6 6
 	use core\Navigation;
7 7
 
8
-	class AdminNavigation extends Navigation{
8
+	class AdminNavigation extends Navigation {
9 9
 
10 10
 		public function setOrdreNavigation($nav) {
11 11
 			$dbc = App::getDb();
12 12
 			$count_nav = count($nav);
13 13
 
14
-			for ($i=0 ; $i<$count_nav ; $i++) {
14
+			for ($i = 0; $i < $count_nav; $i++) {
15 15
 				$lien = explode(".", $nav[$i]);
16 16
 
17 17
 				if ($lien[1] == "page") {
18
-					$dbc->update("ordre", $i+1)->from("navigation")->where("ID_page", "=", $lien[0])->set();
18
+					$dbc->update("ordre", $i + 1)->from("navigation")->where("ID_page", "=", $lien[0])->set();
19 19
 				}
20 20
 				else {
21
-					$dbc->update("ordre", $i+1)->from("navigation")->where("ID_module", "=", $lien[0])->set();
21
+					$dbc->update("ordre", $i + 1)->from("navigation")->where("ID_module", "=", $lien[0])->set();
22 22
 				}
23 23
 			}
24 24
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,7 @@
 block discarded – undo
16 16
 
17 17
 				if ($lien[1] == "page") {
18 18
 					$dbc->update("ordre", $i+1)->from("navigation")->where("ID_page", "=", $lien[0])->set();
19
-				}
20
-				else {
19
+				} else {
21 20
 					$dbc->update("ordre", $i+1)->from("navigation")->where("ID_module", "=", $lien[0])->set();
22 21
 				}
23 22
 			}
Please login to merge, or discard this patch.
core/auth/Membre.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,12 +87,10 @@  discard block
 block discarded – undo
87 87
 			if ((strlen($new_pseudo) < 5) || (strlen($new_pseudo) > 15)) {
88 88
 				$err = "Votre pseudo doit être entre 5 et 15 caractères";
89 89
 				$this->erreur = $err;
90
-			}
91
-			else if ($dbc->rechercherEgalite("identite", "pseudo", $new_pseudo) == false) {
90
+			} else if ($dbc->rechercherEgalite("identite", "pseudo", $new_pseudo) == false) {
92 91
 				$err = "Ce pseudo est déjà utilisé, veuillez en choisir un autre";
93 92
 				$this->erreur = $err;
94
-			}
95
-			else {
93
+			} else {
96 94
 				$dbc->update("pseudo", $new_pseudo)->from("identite")->where("ID_identite", "=", $_SESSION["idlogin".CLEF_SITE])->set();
97 95
 				$this->pseudo = $new_pseudo;
98 96
 			}
@@ -112,12 +110,10 @@  discard block
 block discarded – undo
112 110
 			if (md5($old_mdp) != $mdp) {
113 111
 				$err = "Votre mot de passe est incorrect";
114 112
 				$this->erreur = $err;
115
-			}
116
-			else if ($new_mdp != $verif_new_mdp) {
113
+			} else if ($new_mdp != $verif_new_mdp) {
117 114
 				$err = "Vos mots de passe sont différents";
118 115
 				$this->erreur = $err;
119
-			}
120
-			else {
116
+			} else {
121 117
 				$mdpok = Encrypt::setEncryptMdp($new_mdp, $this->id_identite);
122 118
 				//le nouveau mdp est bon on update
123 119
 				$dbc->update("mdp", $mdpok)->from("identite")->where("ID_identite", "=", $this->id_identite)->set();
Please login to merge, or discard this patch.
core/admin/navigation/menu/gestion.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,11 +5,9 @@
 block discarded – undo
5 5
 
6 6
 		if ($menu_active == "plie") {
7 7
 			$_SESSION["menu_plie".CLEF_SITE] = "deplie";
8
-		}
9
-		else {
8
+		} else {
10 9
 			$_SESSION["menu_plie".CLEF_SITE] = "plie";
11 10
 		}
12
-	}
13
-	else {
11
+	} else {
14 12
 		$_SESSION["menu_plie".CLEF_SITE] = "plie";
15 13
 	}
16 14
\ No newline at end of file
Please login to merge, or discard this patch.
installation.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,12 +18,10 @@
 block discarded – undo
18 18
 
19 19
 			//si c'est un controleur de base on va cerhcer dans core/admin
20 20
 			require_once("installation/controller/".$lien.".php");
21
-		}
22
-		else {
21
+		} else {
23 22
 			require("installation/views/template/principal.php");
24 23
 		}
25
-	}
26
-	else {
24
+	} else {
27 25
 		$page = "installation/views/index";
28 26
 		require("installation/controller/initialise_all.php");
29 27
 		require("installation/views/template/principal.php");
Please login to merge, or discard this patch.
installation/controller/InstallRibs.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
 
26 26
 			try {
27 27
 				$this->dbc = new \PDO($this->db_type.':host='.$this->db_host.';dbname='.$this->db_name, $this->db_user, $this->db_pass);
28
-			}
29
-			catch (\PDOException $e) {
28
+			} catch (\PDOException $e) {
30 29
 				//on tente de créer la bdd
31 30
 				$erreur = "getErreur".$e->getCode();
32 31
 				$this->$erreur();
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 	namespace core\contenus;
3 3
 
4
-	use core\functions\ChaineCaractere;
5 4
 	use core\RedirectError;
6 5
 
7 6
 
Please login to merge, or discard this patch.
core/HTML/flashmessage/FlashMessage.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 					//definit le chemin sachant que l'on part de index.php
45 45
 					$chemin = str_replace("\\", "/", str_replace("index.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/");
46 46
 				}
47
-				else if  (strstr($_SERVER['SCRIPT_NAME'], "installation.php")) {
47
+				else if (strstr($_SERVER['SCRIPT_NAME'], "installation.php")) {
48 48
 					//definit le chemin sachant que l'on part de admin.php
49 49
 					$chemin = str_replace("\\", "/", str_replace("installation.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/");
50 50
 				}
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,11 +17,9 @@  discard block
 block discarded – undo
17 17
 
18 18
 			if ($type == "error") {
19 19
 				$icone = "<i class='fa fa-close'></i>";
20
-			}
21
-			else if ($type == "success") {
20
+			} else if ($type == "success") {
22 21
 				$icone = "<i class='fa fa-check'></i>";
23
-			}
24
-			else {
22
+			} else {
25 23
 				$icone = "<i class='fa fa-info'></i>";
26 24
 			}
27 25
 
@@ -43,12 +41,10 @@  discard block
 block discarded – undo
43 41
 				if (strstr($_SERVER['SCRIPT_NAME'], "index.php")) {
44 42
 					//definit le chemin sachant que l'on part de index.php
45 43
 					$chemin = str_replace("\\", "/", str_replace("index.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/");
46
-				}
47
-				else if  (strstr($_SERVER['SCRIPT_NAME'], "installation.php")) {
44
+				} else if  (strstr($_SERVER['SCRIPT_NAME'], "installation.php")) {
48 45
 					//definit le chemin sachant que l'on part de admin.php
49 46
 					$chemin = str_replace("\\", "/", str_replace("installation.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/");
50
-				}
51
-				else {
47
+				} else {
52 48
 					//definit le chemin sachant que l'on part de admin.php
53 49
 					$chemin = str_replace("\\", "/", str_replace("admin.php", "", $_SERVER['SCRIPT_NAME']).__NAMESPACE__."/view/");
54 50
 				}
Please login to merge, or discard this patch.
installation/controller/bdd/install.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 (isset($_POST['admin'])) {
9 9
 		Connexion::setLogin($pseudo, $mdp, WEBROOT."administrator/login", WEBROOT."administrator");
10
-	}
11
-	else {
10
+	} else {
12 11
 		Connexion::setLogin($pseudo, $mdp, WEBROOT."login", WEBROOT."index.php");
13 12
 	}
14 13
 ?>
15 14
\ No newline at end of file
Please login to merge, or discard this patch.
installation/controller/InstallUtilisateur.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
 				foreach ($query as $obj) {
22 22
 					$params = $obj->mdp_params;
23 23
 				}
24
-			}
25
-			else {
24
+			} else {
26 25
 				$params = self::$params;
27 26
 			}
28 27
 
@@ -74,8 +73,7 @@  discard block
 block discarded – undo
74 73
 
75 74
 			if ($id_identite != null) {
76 75
 				self::setSaveParams("$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20), $id_identite);
77
-			}
78
-			else {
76
+			} else {
79 77
 				self::$params = "$taille_bout1, $debut_bout2, $nb_aleatoire_mdp, $taille_bout2, $debut_bout1, ".ChaineCaractere::random(20);
80 78
 			}
81 79
 
Please login to merge, or discard this patch.