Passed
Push — master ( 41899e...6bbf8c )
by Anthony
02:30
created
modules/bataille/app/controller/CentreRecherche.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 			$query = $dbc1->select("coef_centre_recherche")->from("configuration")->where("ID_configuration", "=", 1)->get();
17 17
 
18 18
 			if ((is_array($query)) && (count($query) == 1)) {
19
-				foreach ($query as $obj) $this->coef_centre = $obj->coef_centre_recherche;
19
+				foreach ($query as $obj) {
20
+					$this->coef_centre = $obj->coef_centre_recherche;
21
+				}
20 22
 			}
21 23
 
22 24
 			$query = $dbc1->select()->from("recherche")
@@ -41,8 +43,7 @@  discard block
 block discarded – undo
41 43
 						];
42 44
 
43 45
 						$temps_recherche = $temps_recherche * ($this->coef_centre * $niveau);
44
-					}
45
-					else {
46
+					} else {
46 47
 						$niveau_recherche = 1;
47 48
 					}
48 49
 
Please login to merge, or discard this patch.
modules/bataille/app/controller/Unite.php 1 patch
Braces   +15 added lines, -10 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
 		}
@@ -92,7 +95,9 @@  discard block
 block discarded – undo
92 95
 			$query = $dbc1->select("type_unite")->from("configuration")->where("ID_configuration", "=", 1)->get();
93 96
 
94 97
 			if ((is_array($query)) && (count($query) == 1)) {
95
-				foreach ($query as $obj) return explode(",", $obj->type_unite);
98
+				foreach ($query as $obj) {
99
+					return explode(",", $obj->type_unite);
100
+				}
96 101
 			}
97 102
 		}
98 103
 
@@ -128,8 +133,7 @@  discard block
 block discarded – undo
128 133
 				foreach ($query as $obj) {
129 134
 					if ($obj->date_fin-$today <= 0) {
130 135
 						$this->setTerminerRecrutement($obj->ID_recrutement);
131
-					}
132
-					else {
136
+					} else {
133 137
 						$recrutement[] = [
134 138
 							"nom" => $obj->nom,
135 139
 							"type" => $obj->type,
@@ -150,7 +154,9 @@  discard block
 block discarded – undo
150 154
 		 */
151 155
 		public function getAllUnites($id_base = null) {
152 156
 
153
-			if ($id_base == null) $id_base = Bataille::getIdBase();
157
+			if ($id_base == null) {
158
+				$id_base = Bataille::getIdBase();
159
+			}
154 160
 
155 161
 			$types = $this->getAllType();
156 162
 			$count_type = count($types);
@@ -240,8 +246,7 @@  discard block
 block discarded – undo
240 246
 			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge" ) {
241 247
 				FlashMessage::setFlash("Pas assez de ressources pour recruter autant d'unités");
242 248
 				return false;
243
-			}
244
-			else {
249
+			} else {
245 250
 				//on retire les ressources
246 251
 				Bataille::getRessource()->setUpdateRessource($retirer_eau, $retirer_electricite, $retirer_fer, $retirer_fuel, 0, "-");
247 252
 
Please login to merge, or discard this patch.