Passed
Push — master ( fa2ac1...7245f1 )
by Anthony
02:48
created
modules/bataille/app/controller/Unite.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@  discard block
 block discarded – undo
19 19
 			$query = $dbc1->select("coef_niveau_unite")->from("configuration")->where("ID_configuration", "=", 1)->get();
20 20
 
21 21
 			if ((is_array($query)) && (count($query) == 1)) {
22
-				foreach ($query as $obj) $this->coef_unite = $obj->coef_niveau_unite;
22
+				foreach ($query as $obj) {
23
+					$this->coef_unite = $obj->coef_niveau_unite;
24
+				}
23 25
 			}
24 26
 		}
25 27
 		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
@@ -53,7 +55,9 @@  discard block
 block discarded – undo
53 55
 				$coef = $this->coef_unite*$niveau;
54 56
 				$coef_ameliorer = $this->coef_unite*($niveau+1);
55 57
 
56
-				if ($niveau == 1) $coef = 1;
58
+				if ($niveau == 1) {
59
+					$coef = 1;
60
+				}
57 61
 
58 62
 				return [
59 63
 					"caracteristique" => [
@@ -76,8 +80,7 @@  discard block
 block discarded – undo
76 80
 					],
77 81
 					"temps_recrutement" => $temps_recrutement
78 82
 				];
79
-			}
80
-			else {
83
+			} else {
81 84
 				return [];
82 85
 			}
83 86
 		}
@@ -115,8 +118,7 @@  discard block
 block discarded – undo
115 118
 				foreach ($query as $obj) {
116 119
 					if ($obj->date_fin-$today <= 0) {
117 120
 						$this->setTerminerRecrutement($obj->ID_recrutement);
118
-					}
119
-					else {
121
+					} else {
120 122
 						$recrutement[] = [
121 123
 							"nom" => $obj->nom,
122 124
 							"type" => $obj->type,
@@ -175,8 +177,7 @@  discard block
 block discarded – undo
175 177
 			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge" ) {
176 178
 				FlashMessage::setFlash("Pas assez de ressources pour recruter autant d'unités");
177 179
 				return false;
178
-			}
179
-			else {
180
+			} else {
180 181
 				//on retire les ressources
181 182
 				Bataille::getRessource()->setUpdateRessource($retirer_eau, $retirer_electricite, $retirer_fer, $retirer_fuel, 0, "-");
182 183
 
@@ -211,7 +212,9 @@  discard block
 block discarded – undo
211 212
 					$type = $obj->type;
212 213
 				}
213 214
 
214
-				if ($type == "unité infanterie") $table = "_bataille_unite";
215
+				if ($type == "unité infanterie") {
216
+					$table = "_bataille_unite";
217
+				}
215 218
 
216 219
 				for ($i=0 ; $i<$nombre ; $i++) {
217 220
 					$dbc->insert("nom_unite", $nom)
Please login to merge, or discard this patch.