Passed
Push — master ( 1d6c2d...fa2ac1 )
by Anthony
09:05
created
modules/bataille/app/controller/Unite.php 1 patch
Braces   +9 added lines, -8 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
 
118
-					}
119
-					else {
121
+					} else {
120 122
 						$nom = $obj->nom;
121 123
 						$type = $obj->type;
122 124
 						$nombre = $obj->nombre;
@@ -179,8 +181,7 @@  discard block
 block discarded – undo
179 181
 			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge" ) {
180 182
 				FlashMessage::setFlash("Pas assez de ressources pour recruter autant d'unités");
181 183
 				return false;
182
-			}
183
-			else {
184
+			} else {
184 185
 				//on retire les ressources
185 186
 				Bataille::getRessource()->setUpdateRessource($retirer_eau, $retirer_electricite, $retirer_fer, $retirer_fuel, 0, "-");
186 187
 
Please login to merge, or discard this patch.