Passed
Push — master ( f99231...67efd0 )
by Anthony
02:51
created
modules/bataille/app/controller/Unite.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,14 +44,14 @@  discard block
 block discarded – undo
44 44
 					$base_carac = unserialize($obj->caracteristique);
45 45
 				}
46 46
 
47
-				$coef = $this->coef_unite*$niveau;
47
+				$coef = $this->coef_unite * $niveau;
48 48
 
49 49
 				if ($niveau == 1) $coef = 1;
50 50
 
51 51
 				return [
52
-					"attaque" => round($base_carac["attaque"]*$coef),
53
-					"defense" => round($base_carac["defense"]*$coef),
54
-					"resistance" => round($base_carac["resistance"]*$coef),
52
+					"attaque" => round($base_carac["attaque"] * $coef),
53
+					"defense" => round($base_carac["defense"] * $coef),
54
+					"resistance" => round($base_carac["resistance"] * $coef),
55 55
 					"vitesse" => $base_carac["vitesse"]
56 56
 				];
57 57
 			}
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 			$unites = Bataille::getCentreRecherche()->getAllRechercheType($type);
71 71
 
72 72
 			//recupérer les caractéristiques de l'unité en question
73
-			for ($i=0 ; $i<count($unites) ; $i++) {
73
+			for ($i = 0; $i < count($unites); $i++) {
74 74
 				$unites[$i]["caracteristique"] = $this->getCaracteristiqueUnite($unites[$i]["recherche"], $unites[$i]["niveau"], $type);
75 75
 			}
76 76
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,9 @@  discard block
 block discarded – undo
15 15
 			$query = $dbc1->select("coef_niveau_unite")->from("configuration")->where("ID_configuration", "=", 1)->get();
16 16
 
17 17
 			if ((is_array($query)) && (count($query) == 1)) {
18
-				foreach ($query as $obj) $this->coef_unite = $obj->coef_niveau_unite;
18
+				foreach ($query as $obj) {
19
+					$this->coef_unite = $obj->coef_niveau_unite;
20
+				}
19 21
 			}
20 22
 		}
21 23
 		//-------------------------- END BUILDER ----------------------------------------------------------------------------//
@@ -46,7 +48,9 @@  discard block
 block discarded – undo
46 48
 
47 49
 				$coef = $this->coef_unite*$niveau;
48 50
 
49
-				if ($niveau == 1) $coef = 1;
51
+				if ($niveau == 1) {
52
+					$coef = 1;
53
+				}
50 54
 
51 55
 				return [
52 56
 					"attaque" => round($base_carac["attaque"]*$coef),
@@ -54,8 +58,7 @@  discard block
 block discarded – undo
54 58
 					"resistance" => round($base_carac["resistance"]*$coef),
55 59
 					"vitesse" => $base_carac["vitesse"]
56 60
 				];
57
-			}
58
-			else {
61
+			} else {
59 62
 				return [];
60 63
 			}
61 64
 		}
Please login to merge, or discard this patch.