Passed
Push — master ( 855a75...d1b130 )
by Anthony
02:47
created
core/modules/GestionModule.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -130,8 +130,7 @@  discard block
 block discarded – undo
130 130
 				foreach ($query as $obj) {
131 131
 					if ($obj->activer == 1) {
132 132
 						return true;
133
-					}
134
-					else {
133
+					} else {
135 134
 						return false;
136 135
 					}
137 136
 				}
@@ -183,8 +182,7 @@  discard block
 block discarded – undo
183 182
 
184 183
 			if ($activer == 1) {
185 184
 				$nav->setAjoutLien("ID_module", self::getUrlToId($url));
186
-			}
187
-			else {
185
+			} else {
188 186
 				$nav->setSupprimerLien("ID_module", self::getUrlToId($url));
189 187
 			}
190 188
 		}
Please login to merge, or discard this patch.
Doc Comments   -3 removed lines patch added patch discarded remove patch
@@ -66,9 +66,6 @@
 block discarded – undo
66 66
 		}
67 67
 
68 68
 		/**
69
-		 * @param null $systeme
70
-		 * recupere la listes des modules ajouter par un autre admin
71
-		 * fonction utilisée uniquement dans la config
72 69
 		 */
73 70
 		public function getListeModule() {
74 71
 			$dbc = App::getDb();
Please login to merge, or discard this patch.
admin/views/gestion-contenus/header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@
 block discarded – undo
7 7
 						<ul>
8 8
 							<?php foreach ($nav[4] as $snav):?>
9 9
 								<li><a href="<?=ADMWEBROOT?>gestion-contenus/modifier-contenu?id=<?=$snav[0]?>" title="<?=$snav[3]?>"><?=$snav[1]?></a></li>
10
-							<?php endforeach;?>
10
+							<?php endforeach; ?>
11 11
 						</ul>
12
-					<?php endif;?>
12
+					<?php endif; ?>
13 13
 				</li>
14
-			<?php endforeach;?>
14
+			<?php endforeach; ?>
15 15
 		</ul>
16 16
 	</div>
17 17
 </nav>
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
@@ -36,12 +36,10 @@  discard block
 block discarded – undo
36 36
 			if ($this->getTestInt($value) === true) {
37 37
 				$this->acces_administration = $value;
38 38
 				return true;
39
-			}
40
-			else if ($this->getTestInt($value) === false) {
39
+			} else if ($this->getTestInt($value) === false) {
41 40
 				$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>";
42 41
 				return false;
43
-			}
44
-			else {
42
+			} else {
45 43
 				return true;
46 44
 			}
47 45
 
@@ -59,12 +57,10 @@  discard block
 block discarded – undo
59 57
 			if ($this->getTestInt($value) === true) {
60 58
 				$this->id_liste_droit_acces = $value;
61 59
 				return true;
62
-			}
63
-			else if ($this->getTestInt($value) === false) {
60
+			} else if ($this->getTestInt($value) === false) {
64 61
 				$this->erreur .= "<li>Le champs accès administration n'est pas au bon format</li>";
65 62
 				return false;
66
-			}
67
-			else {
63
+			} else {
68 64
 				return true;
69 65
 			}
70 66
 
Please login to merge, or discard this patch.
core/mail/Mail.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@  discard block
 block discarded – undo
24 24
 		public function setVerifierMail($email) {
25 25
 			if (filter_var($email, FILTER_VALIDATE_EMAIL)) {
26 26
 				return true;
27
-			}
28
-			else {
27
+			} else {
29 28
 				return false;
30 29
 			}
31 30
 		}
@@ -42,7 +41,9 @@  discard block
 block discarded – undo
42 41
 			//on récupere le mail du site
43 42
 			$config = new \core\Configuration();
44 43
 
45
-			if ($from == null) $from = $config->getMailSite();
44
+			if ($from == null) {
45
+				$from = $config->getMailSite();
46
+			}
46 47
 
47 48
 			$headers = 'Content-type: text/html; charset=utf-8'."\r\n";
48 49
 			$headers .= "From: ".$from;
Please login to merge, or discard this patch.
admin/views/gestion-contenus/modifier-contenu.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 		<button type="submit" class="submit-contenu" type="submit"><i class="fa fa-check"></i>Valider</button>
17 17
 	<?php endif; ?>
18 18
 	<input type="hidden" name="id_page" value="<?=$id_page_courante?>">
19
-	<?php if (($_GET['id'] != 1) && (($droit_acces->getSupprimerPage() == 1)  || ($droit_acces->getSuperAdmin() == 1))):?>
19
+	<?php if (($_GET['id'] != 1) && (($droit_acces->getSupprimerPage() == 1) || ($droit_acces->getSuperAdmin() == 1))):?>
20 20
 		<button id="supprimer-page-contenu" type="button" class="submit-contenu supprimer-page supprimer open-popup" popup="supprimer-page" href="<?=ADMWEBROOT?>controller/core/admin/contenus/gestion/supprimer_page?id=<?=$id_page_courante?>"><i class="fa fa-times"></i>Supprimer cette page</button>
21 21
 	<?php endif; ?>
22 22
 
Please login to merge, or discard this patch.
core/Cache.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -66,8 +66,7 @@  discard block
 block discarded – undo
66 66
 					$this->reload_cache = $obj->reload_cache;
67 67
 					$this->no_cache = $obj->no_cache;
68 68
 				}
69
-			}
70
-			else {
69
+			} else {
71 70
 				$value = [
72 71
 						"nom_fichier" => $this->page,
73 72
 						"reload_cache" => 0
@@ -108,16 +107,14 @@  discard block
 block discarded – undo
108 107
 					require_once($this->chemin_cache);
109 108
 
110 109
 					return true;
111
-				}
112
-				else {
110
+				} else {
113 111
 					if ($this->no_cache == null) {
114 112
 						ob_start();
115 113
 					}
116 114
 
117 115
 					return false;
118 116
 				}
119
-			}
120
-			else {
117
+			} else {
121 118
 				return false;
122 119
 			}
123 120
 		}
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
 		}
@@ -84,8 +83,7 @@  discard block
 block discarded – undo
84 83
 		public function rechercherEgalite($table, $champ, $value, $id_table = null, $id = null) {
85 84
 			if ($id == null) {
86 85
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value'");
87
-			}
88
-			else {
86
+			} else {
89 87
 				$query = $this->getPdo()->query("SELECT COUNT($champ) as nb FROM $table WHERE $champ LIKE '$value' AND $id_table != $id");
90 88
 			}
91 89
 
@@ -94,9 +92,10 @@  discard block
 block discarded – undo
94 92
 					$nb = $obj["nb"];
95 93
 				}
96 94
 
97
-				if ((isset($nb)) && ($nb != 0)) return true;
98
-			}
99
-			else {
95
+				if ((isset($nb)) && ($nb != 0)) {
96
+					return true;
97
+				}
98
+			} else {
100 99
 				return false;
101 100
 			}
102 101
 		}
@@ -113,8 +112,7 @@  discard block
 block discarded – undo
113 112
 
114 113
 			if ($query->rowCount() > 0) {
115 114
 				return true;
116
-			}
117
-			else {
115
+			} else {
118 116
 				return false;
119 117
 			}
120 118
 		}
Please login to merge, or discard this patch.
core/database/Querybuilder.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 		 */
140 140
 		public function get() {
141 141
 			$values = [];
142
-			$requete = $this->req_beginning . implode(",", $this->select_champ) . " FROM " . implode(",", $this->table);
142
+			$requete = $this->req_beginning.implode(",", $this->select_champ)." FROM ".implode(",", $this->table);
143 143
 
144 144
 			if ((!empty($this->conditions)) || (!empty($this->conditions_table))) {
145 145
 				$requete .= $this->getWhereConditions()[0];
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
 
163 163
 			$datas = [];
164 164
 			$count = count($this->champs);
165
-			for ($i=0 ; $i<$count ; $i++) {
165
+			for ($i = 0; $i < $count; $i++) {
166 166
 				$datas[] = $this->champs[$i]."=:".$this->champs[$i];
167 167
 			}
168 168
 
169 169
 			//si on a des conditions alors on sera dans un insert
170
-			$requete = $this->req_beginning . implode(",", $this->table) . " SET " . implode(", ", $datas);
170
+			$requete = $this->req_beginning.implode(",", $this->table)." SET ".implode(", ", $datas);
171 171
 
172 172
 			if ((!empty($this->conditions)) || (!empty($this->conditions_table))) {
173 173
 				$requete .= $this->getWhereConditions()[0];
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		 */
185 185
 		public function del() {
186 186
 			$values = [];
187
-			$requete = $this->req_beginning . implode(",", $this->table);
187
+			$requete = $this->req_beginning.implode(",", $this->table);
188 188
 
189 189
 			if (!empty($this->conditions)) {
190 190
 				$requete .= $this->getWhereConditions()[0];
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
 				$count = count($this->champs_where);
240 240
 
241
-				for ($i=0 ; $i<$count ; $i++) {
241
+				for ($i = 0; $i < $count; $i++) {
242 242
 					$datas[] = $this->champs_where[$i]." ".$this->conditions[$i]." :".str_replace(".", "", $this->champs_where[$i])." ".$this->closure[$i]." ";
243 243
 				}
244 244
 			}
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 				}
250 250
 			}
251 251
 
252
-			return [" WHERE ". implode(" ", $datas), $values];
252
+			return [" WHERE ".implode(" ", $datas), $values];
253 253
 		}
254 254
 
255 255
 		/**
Please login to merge, or discard this patch.
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -119,6 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
 		/**
121 121
 		 * @param string $order
122
+		 * @param string $type
122 123
 		 */
123 124
 		public function orderBy($order, $type = null) {
124 125
 			if ($type === null) $type = "ASC";
@@ -128,6 +129,10 @@  discard block
 block discarded – undo
128 129
 			return $this;
129 130
 		}
130 131
 
132
+		/**
133
+		 * @param integer $debut
134
+		 * @param integer $fin
135
+		 */
131 136
 		public function limit($debut, $fin) {
132 137
 			$this->limit = " LIMIT ".$debut.", ".$fin." ";
133 138
 
Please login to merge, or discard this 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
 			}
@@ -121,7 +120,9 @@  discard block
 block discarded – undo
121 120
 		 * @param string $order
122 121
 		 */
123 122
 		public function orderBy($order, $type = null) {
124
-			if ($type === null) $type = "ASC";
123
+			if ($type === null) {
124
+				$type = "ASC";
125
+			}
125 126
 
126 127
 			$this->order_by = " ORDER BY ".$order." ".$type." ";
127 128
 
Please login to merge, or discard this patch.
core/modules/ImportModule.php 1 patch
Braces   +14 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,8 +21,12 @@  discard block
 block discarded – undo
21 21
 		//-------------------------- CONSTRUCTEUR ----------------------------------------------------------------------------//
22 22
 		public function __construct() {
23 23
 			//On test si dossier temporaire + modules a la racines existes bien sinon on les crées
24
-			if (!file_exists(ROOT."temp")) mkdir(ROOT."temp");
25
-			if (!file_exists(ROOT."modules")) mkdir(ROOT."modules");
24
+			if (!file_exists(ROOT."temp")) {
25
+				mkdir(ROOT."temp");
26
+			}
27
+			if (!file_exists(ROOT."modules")) {
28
+				mkdir(ROOT."modules");
29
+			}
26 30
 		}
27 31
 		//-------------------------- FIN CONSTRUCTEUR ----------------------------------------------------------------------------//
28 32
 		
@@ -95,8 +99,7 @@  discard block
 block discarded – undo
95 99
 				}
96 100
 
97 101
 				FlashMessage::setFlash("Votre module a bien été ajouté au site.", "success");
98
-			}
99
-			else {
102
+			} else {
100 103
 				FlashMessage::setFlash("Le module n'a pas pu être correctement téléchargé et installé, veuillez réesseyer dans un instant");
101 104
 			}
102 105
 		}
@@ -131,8 +134,7 @@  discard block
 block discarded – undo
131 134
 
132 135
 					FlashMessage::setFlash("Votre module a bien été mis à jour", "success");
133 136
 				}
134
-			}
135
-			else {
137
+			} else {
136 138
 				FlashMessage::setFlash("Impossible de télécharger la mise à jour, veuillez réesseyer dans un instant");
137 139
 			}
138 140
 		}
@@ -144,8 +146,7 @@  discard block
 block discarded – undo
144 146
 		private function setSupprimerArchiveTemp() {
145 147
 			if (unlink(TEMPROOT.$this->nom_fichier) == true) {
146 148
 				return true;
147
-			}
148
-			else {
149
+			} else {
149 150
 				return false;
150 151
 			}
151 152
 		}
@@ -190,7 +191,11 @@  discard block
 block discarded – undo
190 191
 				$objects = scandir($url);
191 192
 				foreach ($objects as $object) {
192 193
 					if ($object != "." && $object != "..") {
193
-						if (filetype($url."/".$object) == "dir") $this->supprimerDossier($url."/".$object); else unlink($url."/".$object);
194
+						if (filetype($url."/".$object) == "dir") {
195
+							$this->supprimerDossier($url."/".$object);
196
+						} else {
197
+							unlink($url."/".$object);
198
+						}
194 199
 					}
195 200
 				}
196 201
 				reset($objects);
Please login to merge, or discard this patch.