Passed
Push — master ( cbd1a4...c22ee8 )
by Anthony
03:09
created
core/modules/GestionModule.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,8 +132,7 @@
 block discarded – undo
132 132
 				foreach ($query as $obj) {
133 133
 					if ($obj->activer == 1) {
134 134
 						return true;
135
-					}
136
-					else {
135
+					} else {
137 136
 						return false;
138 137
 					}
139 138
 				}
Please login to merge, or discard this patch.
core/auth/Inscription.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 				if (isset($datas[$i][2])) {
22 22
 					$this->$function($datas[$i][1], $datas[$i][2]);
23
-				}
24
-				else {
23
+				} else {
25 24
 					$this->$function($datas[$i][1]);
26 25
 				}
27 26
 			}
@@ -54,8 +53,7 @@  discard block
 block discarded – undo
54 53
 		protected function getTestRequired($value) {
55 54
 			if (($value == "") || ($value == null) || (strlen($value) == 0)) {
56 55
 				return false;
57
-			}
58
-			else {
56
+			} else {
59 57
 				return true;
60 58
 			}
61 59
 		}
@@ -68,8 +66,7 @@  discard block
 block discarded – undo
68 66
 		protected function getTestLongueur($value, $longeur) {
69 67
 			if (strlen($value) > $longeur) {
70 68
 				return true;
71
-			}
72
-			else {
69
+			} else {
73 70
 				return false;
74 71
 			}
75 72
 		}
@@ -81,8 +78,7 @@  discard block
 block discarded – undo
81 78
 		protected function getTestInt($value) {
82 79
 			if (is_numeric($value)) {
83 80
 				return true;
84
-			}
85
-			else {
81
+			} else {
86 82
 				return false;
87 83
 			}
88 84
 		}
@@ -100,12 +96,10 @@  discard block
 block discarded – undo
100 96
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
101 97
 				$this->erreur .= "<li>$erreur</li>";
102 98
 				return false;
103
-			}
104
-			else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
99
+			} else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
105 100
 				$this->erreur .= "<li>$erreur_long</li>";
106 101
 				return false;
107
-			}
108
-			else {
102
+			} else {
109 103
 				$this->$varaible = $value;
110 104
 				return true;
111 105
 			}
@@ -153,8 +147,7 @@  discard block
 block discarded – undo
153 147
 		protected function setVerifRetapeMdp($value) {
154 148
 			if ($this->mdp == $value) {
155 149
 				return true;
156
-			}
157
-			else {
150
+			} else {
158 151
 				$this->erreur .= "<li>Les mots de passent ne correspondent pas</li>";
159 152
 				$this->mdp = null;
160 153
 				return false;
@@ -182,12 +175,10 @@  discard block
 block discarded – undo
182 175
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
183 176
 				$this->erreur .= "<li>Le champs E-mail ne peut pas être vide</li>";
184 177
 				return false;
185
-			}
186
-			else if (($value != "") && (filter_var($value, FILTER_VALIDATE_EMAIL) == false)) {
178
+			} else if (($value != "") && (filter_var($value, FILTER_VALIDATE_EMAIL) == false)) {
187 179
 				$this->erreur .= "<li>Le champs E-mail doit être une adresse E-mail valide</li>";
188 180
 				return false;
189
-			}
190
-			else {
181
+			} else {
191 182
 				$this->mail = $value;
192 183
 				return true;
193 184
 			}
Please login to merge, or discard this patch.
core/admin/Admin.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@  discard block
 block discarded – undo
26 26
 		public static function testRedirect404($query, $url) {
27 27
 			if (is_array($query)) {
28 28
 				$count_query = count($query);
29
-			}
30
-			else {
29
+			} else {
31 30
 				$count_query = 0;
32 31
 			}
33 32
 
@@ -37,15 +36,13 @@  discard block
 block discarded – undo
37 36
 
38 37
 			if ($pos !== false) {
39 38
 				$controller = true;
40
-			}
41
-			else {
39
+			} else {
42 40
 				$controller = false;
43 41
 			}
44 42
 
45 43
 			if (($count_query > 0) || ((!is_array($query)) && ($query > 0)) || ($controller == true)) {
46 44
 				return true;
47
-			}
48
-			else {
45
+			} else {
49 46
 				$router = new RouterModule();
50 47
 
51 48
 				if ($router->getRouteModuleExist($url) == false) {
Please login to merge, or discard this patch.
core/auth/Membre.php 1 patch
Braces   +5 added lines, -10 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->query("UPDATE identite set pseudo=$new_pseudo WHERE ID_identite=".$_SESSION["idlogin".CLEF_SITE]);
97 95
 				$this->pseudo = $new_pseudo;
98 96
 			}
@@ -112,16 +110,13 @@  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 if ($this->testpassword($new_mdp) == false) {
116
+			} else if ($this->testpassword($new_mdp) == false) {
121 117
 				$err = "Votre mot de passe est trop simple, il doit contenir 5 caractères et au moins un chiffre";
122 118
 				$this->erreur = $err;
123
-			}
124
-			else {
119
+			} else {
125 120
 				$mdpok = Encrypt::setEncryptMdp($new_mdp, $this->id_identite);
126 121
 				//le nouveau mdp est bon on update
127 122
 				$dbc->query("UPDATE identite SET mdp='$mdpok' WHERE ID_identite=".$this->id_identite);
Please login to merge, or discard this patch.
core/images/Images.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
 				$explode = explode("/", $this->chemin_image);
59 59
 				$this->image = end($explode);
60 60
 				return $this->image;
61
-			}
62
-			else {
61
+			} else {
63 62
 				$this->erreur = "Impossible de trouver votre image, vuellez réessayer dans un instant";
64 63
 				return false;
65 64
 			}
@@ -87,8 +86,7 @@  discard block
 block discarded – undo
87 86
 			if ((empty($_FILES[$name]['name'])) && ($autorize_empty == 0)) {
88 87
 				$this->erreur = "Vous devez obligatoirement ajouter une image";
89 88
 				return false;
90
-			}
91
-			else {
89
+			} else {
92 90
 				//test si il y a deja une img
93 91
 				if ($old_image_req != null) {
94 92
 					$query = $dbc->query($old_image_req);
@@ -106,8 +104,7 @@  discard block
 block discarded – undo
106 104
 				if ((!in_array(substr($image, -3), $this->autorized_extention)) || (($infos_img[0] >= $this->width_max) && ($infos_img[1] >= $this->height_max) && ($_FILES[$name]['size'] >= $this->poid_max))) {
107 105
 					$this->erreur = "Problème dans les dimensions, taille ou format (extension) de l'image.";
108 106
 					return false;
109
-				}
110
-				else if (move_uploaded_file($_FILES[$name]['tmp_name'], $this->dossier_image."/".$uniqid.substr($image, -4))) {
107
+				} else if (move_uploaded_file($_FILES[$name]['tmp_name'], $this->dossier_image."/".$uniqid.substr($image, -4))) {
111 108
 					$imageok = $uniqid.substr($image, -4);
112 109
 
113 110
 					$urlimg = $this->dossier_image."/$imageok";
@@ -119,8 +116,7 @@  discard block
 block discarded – undo
119 116
 					}
120 117
 
121 118
 					return true;
122
-				}
123
-				else {
119
+				} else {
124 120
 					$this->erreur = "Impossible d'envoyer votre image sur le serveur, veuillez réessayer dans une instant, si l'erreur se reproduit, contactez votre administrateur";
125 121
 				}
126 122
 			}
@@ -145,8 +141,7 @@  discard block
 block discarded – undo
145 141
 				$resize->saveImage($this->dossier_image."/".$img_resize, 100);
146 142
 
147 143
 				$this->nom_image = $img_resize;
148
-			}
149
-			else {
144
+			} else {
150 145
 				$this->nom_image = null;
151 146
 			}
152 147
 
@@ -170,11 +165,9 @@  discard block
 block discarded – undo
170 165
 					unlink($this->dossier_image."/".end($old_image));
171 166
 					return true;
172 167
 				}
173
-			}
174
-			else if (($nom_image !== null) && (unlink($this->dossier_image."/".$nom_image))) {
168
+			} else if (($nom_image !== null) && (unlink($this->dossier_image."/".$nom_image))) {
175 169
 				return true;
176
-			}
177
-			else {
170
+			} else {
178 171
 				$this->erreur = "Impossible de supprimer cette image, veuillez réesayer dans un instant, sinon contacter l'administrateur de votre site";
179 172
 				return false;
180 173
 			}
Please login to merge, or discard this patch.
core/modules/ImportModule.php 1 patch
Braces   +15 added lines, -11 removed lines patch added patch discarded remove patch
@@ -20,8 +20,12 @@  discard block
 block discarded – undo
20 20
 		//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
21 21
 		public function __construct() {
22 22
 			//On test si dossier temporaire + modules a la racines existes bien sinon on les crées
23
-			if (!file_exists(ROOT."temp")) mkdir(ROOT."temp");
24
-			if (!file_exists(ROOT."modules")) mkdir(ROOT."modules");
23
+			if (!file_exists(ROOT."temp")) {
24
+				mkdir(ROOT."temp");
25
+			}
26
+			if (!file_exists(ROOT."modules")) {
27
+				mkdir(ROOT."modules");
28
+			}
25 29
 		}
26 30
 		//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
27 31
 		
@@ -83,8 +87,7 @@  discard block
 block discarded – undo
83 87
 				}
84 88
 
85 89
 				FlashMessage::setFlash("Votre module a bien été ajouté au site.", "success");
86
-			}
87
-			else {
90
+			} else {
88 91
 
89 92
 				FlashMessage::setFlash("Le module n'a pas pu être correctement téléchargé et installé, veuillez réesseyer dans un instant");
90 93
 			}
@@ -124,8 +127,7 @@  discard block
 block discarded – undo
124 127
 
125 128
 					FlashMessage::setFlash("Votre module a bien été mis à jour", "success");
126 129
 				}
127
-			}
128
-			else {
130
+			} else {
129 131
 				FlashMessage::setFlash("Impossible de télécharger la mise à jour, veuillez réesseyer dans un instant");
130 132
 			}
131 133
 		}
@@ -137,8 +139,7 @@  discard block
 block discarded – undo
137 139
 		private function setSupprimerArchiveTemp() {
138 140
 			if (unlink(TEMPROOT.$this->nom_fichier) == true) {
139 141
 				return true;
140
-			}
141
-			else {
142
+			} else {
142 143
 				return false;
143 144
 			}
144 145
 		}
@@ -169,8 +170,7 @@  discard block
 block discarded – undo
169 170
 				);
170 171
 
171 172
 				$dbc->prepare("UPDATE module SET activer=:activer, installer=:installer WHERE ID_module=:id_module", $value);
172
-			}
173
-			else {
173
+			} else {
174 174
 				$value = array(
175 175
 					"id_module" => $id_module,
176 176
 				);
@@ -213,7 +213,11 @@  discard block
 block discarded – undo
213 213
 				$objects = scandir($url);
214 214
 				foreach ($objects as $object) {
215 215
 					if ($object != "." && $object != "..") {
216
-						if (filetype($url."/".$object) == "dir") $this->supprimerDossier($url."/".$object); else unlink($url."/".$object);
216
+						if (filetype($url."/".$object) == "dir") {
217
+							$this->supprimerDossier($url."/".$object);
218
+						} else {
219
+							unlink($url."/".$object);
220
+						}
217 221
 					}
218 222
 				}
219 223
 				reset($objects);
Please login to merge, or discard this patch.
core/admin/droitsacces/DroitAcces.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -41,25 +41,25 @@  discard block
 block discarded – undo
41 41
     
42 42
     
43 43
 		//-------------------------- GETTER ----------------------------------------------------------------------------//
44
-		public function getLogged(){
44
+		public function getLogged() {
45 45
 			return $this->logged;
46 46
 		}
47
-		public function getSuperAdmin(){
47
+		public function getSuperAdmin() {
48 48
 			return $this->super_admin;
49 49
 		}
50
-		public function getIdListeDroitAcces(){
50
+		public function getIdListeDroitAcces() {
51 51
 			return $this->id_liste_droit_acces;
52 52
 		}
53
-		public function getModifSeo(){
53
+		public function getModifSeo() {
54 54
 			return $this->modif_seo;
55 55
 		}
56
-		public function getModifContenu(){
56
+		public function getModifContenu() {
57 57
 			return $this->modif_contenu;
58 58
 		}
59
-		public function getModifNavigation(){
59
+		public function getModifNavigation() {
60 60
 			return $this->modif_navigation;
61 61
 		}
62
-		public function getSupprimerPage(){
62
+		public function getSupprimerPage() {
63 63
 			return $this->supprimer_page;
64 64
 		}
65 65
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			//page sans droit dans admin
142 142
 			$all_access = array("gestion-comptes/mon-compte", "index");
143 143
 
144
-			if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces()))|| (in_array($page, $all_access))) {
144
+			if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces())) || (in_array($page, $all_access))) {
145 145
 				return true;
146 146
 			}
147 147
 			else {
Please login to merge, or discard this patch.
Braces   +9 added lines, -8 removed lines patch added patch discarded remove patch
@@ -78,7 +78,9 @@  discard block
 block discarded – undo
78 78
 				");
79 79
 
80 80
 			if ((is_array($query)) && (count($query) > 0)) {
81
-				foreach ($query as $obj) $liste_droit_acces[] = $obj->droit_acces;
81
+				foreach ($query as $obj) {
82
+					$liste_droit_acces[] = $obj->droit_acces;
83
+				}
82 84
 			}
83 85
 
84 86
 			return $liste_droit_acces;
@@ -93,7 +95,9 @@  discard block
 block discarded – undo
93 95
 
94 96
 			$query = $dbc->query("SELECT droit_acces FROM droit_acces WHERE page LIKE '%$page%'");
95 97
 			if ((is_array($query)) && (count($query) > 0)) {
96
-				foreach ($query as $obj) $droit_acces = $obj->droit_acces;
98
+				foreach ($query as $obj) {
99
+					$droit_acces = $obj->droit_acces;
100
+				}
97 101
 			}
98 102
 
99 103
 			return $droit_acces;
@@ -143,8 +147,7 @@  discard block
 block discarded – undo
143 147
 
144 148
 			if (($this->super_admin == 1) || (in_array($this->getListeDroitPage($page), $this->getListeDroitAcces()))|| (in_array($page, $all_access))) {
145 149
 				return true;
146
-			}
147
-			else {
150
+			} else {
148 151
 				return false;
149 152
 			}
150 153
 		}
@@ -169,8 +172,7 @@  discard block
 block discarded – undo
169 172
 			//si les trois sont différent de 0 on renvoit true soinon false
170 173
 			if (($this->super_admin == 1) || ((in_array($droit, $liste_droit_acces)) && in_array(1, $array_modif))) {
171 174
 				return true;
172
-			}
173
-			else {
175
+			} else {
174 176
 				return false;
175 177
 			}
176 178
 		}
@@ -185,8 +187,7 @@  discard block
 block discarded – undo
185 187
 
186 188
 			if (($this->super_admin == 1) || (in_array($droit_acces, $liste_droit_acces))) {
187 189
 				return true;
188
-			}
189
-			else {
190
+			} else {
190 191
 				return false;
191 192
 			}
192 193
 		}
Please login to merge, or discard this patch.