Passed
Push — master ( 8543ab...7db5d1 )
by Anthony
03:06
created
core/auth/Inscription.class.php 1 patch
Braces   +20 added lines, -40 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 				if (isset($datas[$i][2])) {
21 21
 					$this->$function($datas[$i][1], $datas[$i][2]);
22
-				}
23
-				else {
22
+				} else {
24 23
 					$this->$function($datas[$i][1]);
25 24
 				}
26 25
 			}
@@ -53,8 +52,7 @@  discard block
 block discarded – undo
53 52
 		protected function getTestRequired($value) {
54 53
 			if (($value == "") || ($value == null) || (strlen($value) == 0)) {
55 54
 				return false;
56
-			}
57
-			else {
55
+			} else {
58 56
 				return true;
59 57
 			}
60 58
 		}
@@ -67,8 +65,7 @@  discard block
 block discarded – undo
67 65
 		protected function getTestLongueur($value, $longeur) {
68 66
 			if (strlen($value) > $longeur) {
69 67
 				return true;
70
-			}
71
-			else {
68
+			} else {
72 69
 				return false;
73 70
 			}
74 71
 		}
@@ -80,8 +77,7 @@  discard block
 block discarded – undo
80 77
 		protected function getTestInt($value) {
81 78
 			if (is_numeric($value)) {
82 79
 				return true;
83
-			}
84
-			else {
80
+			} else {
85 81
 				return false;
86 82
 			}
87 83
 		}
@@ -101,17 +97,14 @@  discard block
 block discarded – undo
101 97
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
102 98
 				$this->erreur .= "<li>Le champs nom ne peut pas être vide</li>";
103 99
 				return false;
104
-			}
105
-			else {
100
+			} else {
106 101
 				if (($value != "") && ($this->getTestLongueur($value, 2) === true)) {
107 102
 					$this->nom = $value;
108 103
 					return true;
109
-				}
110
-				else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
104
+				} else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
111 105
 					$this->erreur .= "<li>Le champs nom soit être supérieur à deux caractères</li>";
112 106
 					return false;
113
-				}
114
-				else {
107
+				} else {
115 108
 					return true;
116 109
 				}
117 110
 			}
@@ -128,17 +121,14 @@  discard block
 block discarded – undo
128 121
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
129 122
 				$this->erreur .= "<li>Le champs prénom ne peut pas être vide</li>";
130 123
 				return false;
131
-			}
132
-			else {
124
+			} else {
133 125
 				if (($value != "") && ($this->getTestLongueur($value, 2) === true)) {
134 126
 					$this->prenom = $value;
135 127
 					return true;
136
-				}
137
-				else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
128
+				} else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
138 129
 					$this->erreur .= "<li>Le champs prénom soit être supérieur à deux caractères</li>";
139 130
 					return false;
140
-				}
141
-				else {
131
+				} else {
142 132
 					return true;
143 133
 				}
144 134
 			}
@@ -155,17 +145,14 @@  discard block
 block discarded – undo
155 145
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
156 146
 				$this->erreur .= "<li>Le champs mot de passe ne peut pas être vide</li>";
157 147
 				return false;
158
-			}
159
-			else {
148
+			} else {
160 149
 				if (($value != "") && ($this->getTestLongueur($value, 2) === true)) {
161 150
 					$this->mdp = $value;
162 151
 					return true;
163
-				}
164
-				else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
152
+				} else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
165 153
 					$this->erreur .= "<li>Le champs mot de passe soit être supérieur à deux caractères</li>";
166 154
 					return false;
167
-				}
168
-				else {
155
+				} else {
169 156
 					return true;
170 157
 				}
171 158
 			}
@@ -180,8 +167,7 @@  discard block
 block discarded – undo
180 167
 		protected function setVerifRetapeMdp($value, $required=null) {
181 168
 			if ($this->mdp == $value) {
182 169
 				return true;
183
-			}
184
-			else {
170
+			} else {
185 171
 				$this->erreur .= "<li>Les mots de passent ne correspondent pas</li>";
186 172
 				$this->mdp = null;
187 173
 				return false;
@@ -199,17 +185,14 @@  discard block
 block discarded – undo
199 185
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
200 186
 				$this->erreur .= "<li>Le champs pseudo ne peut pas être vide</li>";
201 187
 				return false;
202
-			}
203
-			else {
188
+			} else {
204 189
 				if (($value != "") && ($this->getTestLongueur($value, 2) === true)) {
205 190
 					$this->pseudo = $value;
206 191
 					return true;
207
-				}
208
-				else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
192
+				} else if (($value != "") && ($this->getTestLongueur($value, 2) === false)) {
209 193
 					$this->erreur .= "<li>Le champs pseudo soit être supérieur à deux caractères</li>";
210 194
 					return false;
211
-				}
212
-				else {
195
+				} else {
213 196
 					return true;
214 197
 				}
215 198
 			}
@@ -226,17 +209,14 @@  discard block
 block discarded – undo
226 209
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
227 210
 				$this->erreur .= "<li>Le champs E-mail ne peut pas être vide</li>";
228 211
 				return false;
229
-			}
230
-			else {
212
+			} else {
231 213
 				if (($value != "") && (filter_var($value, FILTER_VALIDATE_EMAIL) != false)) {
232 214
 					$this->mail = $value;
233 215
 					return true;
234
-				}
235
-				else if (($value != "") && (filter_var($value, FILTER_VALIDATE_EMAIL) == false)) {
216
+				} else if (($value != "") && (filter_var($value, FILTER_VALIDATE_EMAIL) == false)) {
236 217
 					$this->erreur .= "<li>Le champs E-mail doit être une adresse E-mail valide</li>";
237 218
 					return false;
238
-				}
239
-				else {
219
+				} else {
240 220
 					return true;
241 221
 				}
242 222
 			}
Please login to merge, or discard this patch.
core/auth/Membre.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 		
18 18
 		//------------------------------ constructeur-----------------------------------
19 19
 		//Récupérer en base de données les infos du membre
20
-		public function __construct($id_identite=null){
20
+		public function __construct($id_identite = null) {
21 21
 			$dbc = \core\App::getDb();
22 22
 
23 23
 			$this->debut_lien = IMGROOT."profil/";
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		/**
84 84
 		 * @param null $id_identite
85 85
 		 */
86
-		public function setSupprimUser($id_identite=null) {
86
+		public function setSupprimUser($id_identite = null) {
87 87
 			$dbc = \core\App::getDb();
88 88
 
89 89
 			if ($id_identite == null) {
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 			$oldimg_profil = $obj->img_profil;
98 98
 			if ($oldimg_profil != "") {
99 99
 				$oldimg_profil = explode("/", $oldimg_profil);
100
-				if(end($oldimg_profil) == "defaut.png") {
100
+				if (end($oldimg_profil) == "defaut.png") {
101 101
 					
102 102
 				}
103 103
 				else {
@@ -192,22 +192,22 @@  discard block
 block discarded – undo
192 192
 		 * @param string $mdp
193 193
 		 * @return integer
194 194
 		 */
195
-		private function testpassword($mdp)	{
195
+		private function testpassword($mdp) {
196 196
 			$longueur = strlen($mdp);
197 197
 			$point = 0;
198 198
 
199
-			for ($i=0 ; $i<$longueur ; $i++) 	{
199
+			for ($i = 0; $i < $longueur; $i++) {
200 200
 				$lettre = $mdp[$i];
201 201
 
202 202
 				if ($lettre >= 'a' && $lettre <= 'z') {
203 203
 					$point = $point + 1;
204 204
 					$point_min = 1;
205 205
 				}
206
-				else if ($lettre >= 'A' && $lettre <= 'Z'){
206
+				else if ($lettre >= 'A' && $lettre <= 'Z') {
207 207
 					$point = $point + 2;
208 208
 					$point_maj = 2;
209 209
 				}
210
-				else if ($lettre >= '0' && $lettre <= '9'){
210
+				else if ($lettre >= '0' && $lettre <= '9') {
211 211
 					$point = $point + 3;
212 212
 					$point_chiffre = 3;
213 213
 				}
Please login to merge, or discard this patch.
core/form/FormValidator.class.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <?php
2
-    namespace core\form;
2
+	namespace core\form;
3 3
 
4
-    class FormValidator {
5
-        private $datas = [];
6
-        private $errors = [];
4
+	class FormValidator {
5
+		private $datas = [];
6
+		private $errors = [];
7 7
 
8 8
 
9
-        //-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
10
-        public function __construct($datas) {
11
-            $this->datas = $datas;
12
-        }
13
-        //-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
9
+		//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
10
+		public function __construct($datas) {
11
+			$this->datas = $datas;
12
+		}
13
+		//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
14 14
 
15 15
 
16
-        //-------------------------- GETTER ----------------------------------------------------------------------------//
17
-        public function Check($name, $rule, $option=null) {
18
-            $validator = "validate".ucfirst($rule);
16
+		//-------------------------- GETTER ----------------------------------------------------------------------------//
17
+		public function Check($name, $rule, $option=null) {
18
+			$validator = "validate".ucfirst($rule);
19 19
 
20
-            if (!$this->$validator($name, $option)) {
21
-                $this->errors[$name] = "Le champ $name n'a pas été rempli correctement";
22
-            }
23
-        }
20
+			if (!$this->$validator($name, $option)) {
21
+				$this->errors[$name] = "Le champ $name n'a pas été rempli correctement";
22
+			}
23
+		}
24 24
 
25
-        public function getErrors() {
26
-            if (!empty($this->errors)) {
27
-                $errors = "<ul>";
28
-                foreach ($this->errors as $error) {
29
-                    $errors .= "<li>".$error."</li>";
30
-                }
31
-                $errors .= "</ul>";
25
+		public function getErrors() {
26
+			if (!empty($this->errors)) {
27
+				$errors = "<ul>";
28
+				foreach ($this->errors as $error) {
29
+					$errors .= "<li>".$error."</li>";
30
+				}
31
+				$errors .= "</ul>";
32 32
 
33
-                return $errors;
34
-            }
35
-        }
36
-        //-------------------------- FIN GETTER ----------------------------------------------------------------------------//
33
+				return $errors;
34
+			}
35
+		}
36
+		//-------------------------- FIN GETTER ----------------------------------------------------------------------------//
37 37
 
38 38
 
39
-        //-------------------------- SETTER ----------------------------------------------------------------------------//
40
-        public function validateRequired($name) {
41
-            return array_key_exists($name, $this->datas) && $this->datas[$name] != "";
42
-        }
39
+		//-------------------------- SETTER ----------------------------------------------------------------------------//
40
+		public function validateRequired($name) {
41
+			return array_key_exists($name, $this->datas) && $this->datas[$name] != "";
42
+		}
43 43
 
44
-        public function validateEmail($name) {
45
-            return array_key_exists($name, $this->datas) && filter_var($this->datas[$name], FILTER_VALIDATE_EMAIL);
46
-        }
47
-        //-------------------------- FIN SETTER ----------------------------------------------------------------------------//
48
-    }
49 44
\ No newline at end of file
45
+		public function validateEmail($name) {
46
+			return array_key_exists($name, $this->datas) && filter_var($this->datas[$name], FILTER_VALIDATE_EMAIL);
47
+		}
48
+		//-------------------------- FIN SETTER ----------------------------------------------------------------------------//
49
+	}
50 50
\ No newline at end of file
Please login to merge, or discard this patch.
core/admin/inscription/AdminInscription.class.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,17 +36,14 @@  discard block
 block discarded – undo
36 36
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
37 37
 				$this->erreur .= "<li>Le champs accès administration ne peut pas être vide</li>";
38 38
 				return false;
39
-			}
40
-			else {
39
+			} else {
41 40
 				if (($value != "") && ($this->getTestInt($value) === true)) {
42 41
 					$this->acces_administration = $value;
43 42
 					return true;
44
-				}
45
-				else if (($value != "") && ($this->getTestInt($value) === false)) {
43
+				} else if (($value != "") && ($this->getTestInt($value) === false)) {
46 44
 					$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>";
47 45
 					return false;
48
-				}
49
-				else {
46
+				} else {
50 47
 					return true;
51 48
 				}
52 49
 			}
@@ -64,17 +61,14 @@  discard block
 block discarded – undo
64 61
 			if (($required != null) && ($this->getTestRequired($value) === false)) {
65 62
 				$this->erreur .= "<li>Le champs accès administration ne peut pas être vide</li>";
66 63
 				return false;
67
-			}
68
-			else {
64
+			} else {
69 65
 				if (($value != "") && ($this->getTestInt($value) === true)) {
70 66
 					$this->id_liste_droit_acces = $value;
71 67
 					return true;
72
-				}
73
-				else if (($value != "") && ($this->getTestInt($value) === false)) {
68
+				} else if (($value != "") && ($this->getTestInt($value) === false)) {
74 69
 					$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>";
75 70
 					return false;
76
-				}
77
-				else {
71
+				} else {
78 72
 					return true;
79 73
 				}
80 74
 			}
Please login to merge, or discard this patch.
admin/views/configuration/module.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@  discard block
 block discarded – undo
7 7
 <script src="<?=LIBSWEBROOT?>checkbox/js/anim.js"></script>
8 8
 <link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>popup/css/style.css">
9 9
 <script src="<?=LIBSWEBROOT?>popup/js/popup.js"></script>
10
-<?php require_once(ROOT."admin/views/configuration/js/configuration.php");?>
11
-<?php require_once('header.php');?>
10
+<?php require_once(ROOT."admin/views/configuration/js/configuration.php"); ?>
11
+<?php require_once('header.php'); ?>
12 12
 
13 13
 <div class="inner">
14
-	<?php require_once(LIBSROOT."barre_chargement/index.php");?>
14
+	<?php require_once(LIBSROOT."barre_chargement/index.php"); ?>
15 15
 	<div class="contenu modifier-contenu">
16 16
 		<h2>Ajouter un module</h2>
17 17
 		<form action="<?=ADMWEBROOT?>controller/core/modules/installation/installer" method="get" id="form-install">
@@ -36,23 +36,23 @@  discard block
 block discarded – undo
36 36
 				</tr>
37 37
 			</thead>
38 38
 			<tbody>
39
-				<?php for ($i=0 ; $i<count($gestion_module_page_syst->getIdModule()) ; $i++):?>
39
+				<?php for ($i = 0; $i < count($gestion_module_page_syst->getIdModule()); $i++):?>
40 40
 					<tr>
41 41
 						<td><?=$gestion_module_page_syst->getNom()[$i]?></td>
42 42
 						<td>
43 43
 							<label for="<?=$gestion_module_page_syst->getUrl()[$i]?>" class="checkbox-perso switched">
44
-								<input type="checkbox" class="test-check" id="<?=$gestion_module_page_syst->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true): ?>checked<?php endif;?> <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === false):?>disabled<?php endif;?>>
44
+								<input type="checkbox" class="test-check" id="<?=$gestion_module_page_syst->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true): ?>checked<?php endif; ?> <?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === false):?>disabled<?php endif; ?>>
45 45
 							</label>
46 46
 						</td>
47 47
 						<td>
48 48
 							<?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === true) { ?>
49 49
 								<a class="open-popup" popup="popup-delete-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/supprimer?id_module=<?=$gestion_module_page_syst->getIdModule()[$i]?>">Supprimer</a>
50
-							<?php }else{ ?>
50
+							<?php } else { ?>
51 51
 								<a class="installer-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/installer?url=<?=$gestion_module_page_syst->getUrlTelechargement()[$i]?>">Installer</a>
52 52
 							<?php }?>
53 53
 						</td>
54 54
 						<td>
55
-							<?php if ((\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === true) && (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true)){ ?>
55
+							<?php if ((\core\modules\GestionModule::getModuleInstaller($gestion_module_page_syst->getNom()[$i]) === true) && (\core\modules\GestionModule::getModuleActiver($gestion_module_page_syst->getNom()[$i]) === true)) { ?>
56 56
 								<?php if (\core\modules\GestionModule::getModuleAJour($gestion_module_page_syst->getNom()[$i]) != 1) { ?>
57 57
 									<a href="<?=ADMWEBROOT?>controller/core/modules/installation/update?id_module=<?=$gestion_module_page_syst->getIdModule()[$i]?>" class="open-popup" popup="popup-update-module">Mettre à jour</a>
58 58
 								<?php } else {?>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 							<?php }?>
64 64
 						</td>
65 65
 					</tr>
66
-				<?php endfor;?>
66
+				<?php endfor; ?>
67 67
 			</tbody>
68 68
 		</table>
69 69
 	</div>
@@ -79,23 +79,23 @@  discard block
 block discarded – undo
79 79
 				</tr>
80 80
 			</thead>
81 81
 			<tbody>
82
-				<?php for ($i=0 ; $i<count($gestion_module_page->getIdModule()) ; $i++):?>
82
+				<?php for ($i = 0; $i < count($gestion_module_page->getIdModule()); $i++):?>
83 83
 					<tr>
84 84
 						<td><?=$gestion_module_page->getNom()[$i]?></td>
85 85
 						<td>
86 86
 							<label for="<?=$gestion_module_page->getUrl()[$i]?>" class="checkbox-perso switched">
87
-								<input type="checkbox" class="test-check" id="<?=$gestion_module_page->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page->getNom()[$i]) === true): ?>checked<?php endif;?>>
87
+								<input type="checkbox" class="test-check" id="<?=$gestion_module_page->getUrl()[$i]?>" <?php if (\core\modules\GestionModule::getModuleActiver($gestion_module_page->getNom()[$i]) === true): ?>checked<?php endif; ?>>
88 88
 							</label>
89 89
 						</td>
90 90
 						<td>
91 91
 							<?php if (\core\modules\GestionModule::getModuleInstaller($gestion_module_page->getNom()[$i]) === true) { ?>
92 92
 								<a class="supprimer open-popup" popup="popup-delete-module" href="<?=ADMWEBROOT?>controller/core/modules/installation/supprimer?id_module=<?=$gestion_module_page->getIdModule()[$i]?>">Supprimer</a>
93
-							<?php }else{ ?>
93
+							<?php } else { ?>
94 94
 								<a href="<?=ADMWEBROOT?>controller/core/modules/installation/installer?url=<?=$gestion_module_page->getUrlTelechargement()[$i]?>">Installer</a>
95 95
 							<?php }?>
96 96
 						</td>
97 97
 					</tr>
98
-				<?php endfor;?>
98
+				<?php endfor; ?>
99 99
 			</tbody>
100 100
 		</table>
101 101
 	</div>
Please login to merge, or discard this patch.