Passed
Push — master ( c60e25...5c42a2 )
by Anthony
02:55
created
modules/bataille/app/controller/Unite.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 			$unites = Bataille::getCentreRecherche()->getAllRechercheType($type);
100 100
 
101 101
 			//recupérer les caractéristiques de l'unité en question
102
-			for ($i=0 ; $i<count($unites) ; $i++) {
102
+			for ($i = 0; $i < count($unites); $i++) {
103 103
 				$unites[$i] += $this->getCaracteristiqueUnite($unites[$i]["recherche"], $unites[$i]["niveau"], $type);
104 104
 				$unites[$i] += ["type" => $type];
105 105
 			}
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 			$count_type = count($types);
150 150
 			$unites = [];
151 151
 
152
-			for ($i=0 ; $i<$count_type ; $i++) {
152
+			for ($i = 0; $i < $count_type; $i++) {
153 153
 				$type_unite = $this->getAllUniteType($types[$i], $id_base);
154 154
 
155 155
 				$unites = array_merge($unites, $type_unite);
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 			$fuel = Bataille::getTestAssezRessourceBase("fuel", $retirer_fuel);
232 232
 
233 233
 
234
-			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge" ) {
234
+			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge") {
235 235
 				FlashMessage::setFlash("Pas assez de ressources pour recruter autant d'unités");
236 236
 				return false;
237 237
 			}
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 					$type = $obj->type;
271 271
 				}
272 272
 
273
-				for ($i=0 ; $i<$nombre ; $i++) {
273
+				for ($i = 0; $i < $nombre; $i++) {
274 274
 					$dbc->insert("nom", $nom)
275 275
 						->insert("type", $type)
276 276
 						->insert("ID_base", Bataille::getIdBase())
Please login to merge, or discard this patch.
modules/bataille/app/controller/Aide.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -93,12 +93,12 @@  discard block
 block discarded – undo
93 93
 		private function getPourConstruire($pour_construire) {
94 94
 			$count = count($pour_construire);
95 95
 			$batiment = [];
96
-			for ($i = 0 ; $i < $count ; $i++) {
96
+			for ($i = 0; $i < $count; $i++) {
97 97
 				//si plusieur batiment pour construire le batiment en question
98 98
 				$count = count($pour_construire[$i]);
99 99
 				if ($count > 1) {
100
-					for ($j = 0 ; $j < $count ; $j++) {
101
-						$batiment[] =  [
100
+					for ($j = 0; $j < $count; $j++) {
101
+						$batiment[] = [
102 102
 							"nom_batiment" => $pour_construire[$i][$j][0],
103 103
 							"niveau_batiment" => $pour_construire[$i][$j][2]
104 104
 						];
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 					return ["batiments" => $batiment];
108 108
 				}
109 109
 				else {
110
-					$batiment[] =  [
110
+					$batiment[] = [
111 111
 						"nom_batiment" => $pour_construire[$i][0][0],
112 112
 						"niveau_batiment" => $pour_construire[$i][0][2]
113 113
 					];
Please login to merge, or discard this patch.
modules/bataille/app/controller/Points.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 		 * fonction qui ajoute des points à la base en fonction du type
57 57
 		 * le type peut etre : batiment, attaque, defense, troupe
58 58
 		 */
59
-		public static function setAjouterPoints($id_base, $type=null, $points=null) {
59
+		public static function setAjouterPoints($id_base, $type = null, $points = null) {
60 60
 			$dbc = App::getDb();
61 61
 
62 62
 			if ($type == "batiment") {
Please login to merge, or discard this patch.
modules/bataille/app/controller/MissionsAleatoire.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 			
151 151
 			if ((is_array($query)) && (count($query) > 0)) {
152 152
 				foreach ($query as $obj) {
153
-					$missions[] =[
153
+					$missions[] = [
154 154
 						"id_missions_cours" => $obj->ID_missions_cours,
155 155
 						"date_fin" => $obj->date_fin-Bataille::getToday(),
156 156
 						"infos" => $this->getInfosMission($obj->ID_mission)
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 			$count = count($nombre_unite);
249 249
 			
250 250
 			
251
-			for ($i=0 ; $i<$count ; $i++) {
251
+			for ($i = 0; $i < $count; $i++) {
252 252
 				Bataille::getUnite()->setCommencerExpedition($nombre_unite[$i], $nom_unite[$i], $type_unite[$i], $id_missions_cours);
253 253
 			}
254 254
 			
Please login to merge, or discard this patch.
modules/messagerie/app/controller/Messagerie.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 		public function getMessage() {
55 55
 			return $this->message;
56 56
 		}
57
-		public function getDateMessage(){
57
+		public function getDateMessage() {
58 58
 		    return $this->date_message;
59 59
 		}
60
-		public function getUrl(){
60
+		public function getUrl() {
61 61
 		    return $this->url;
62 62
 		}
63 63
 		public function getIdExpediteur() {
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 		public function getPseudoReceveur() {
73 73
 			return $this->pseudo_receveur;
74 74
 		}
75
-		public function getValues(){
75
+		public function getValues() {
76 76
 		    return ["messagerie" => $this->values];
77 77
 		}
78 78
 
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 				$destinataires = explode(",", $destinataire);
321 321
 				$c = count($destinataires);
322 322
 
323
-				for ($i=0 ; $i<$c ; $i++) {
323
+				for ($i = 0; $i < $c; $i++) {
324 324
 					if ($this->getIdIdentiteExist($destinataires[$i]) !== false) {
325 325
 						$destinataires[] = $this->getIdIdentiteExist($destinataires[$i]);
326 326
 						$expediteur = $_SESSION['idlogin'.CLEF_SITE];
Please login to merge, or discard this patch.
modules/bataille/app/controller/CentreRecherche.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
 		 * fonction qui renvoi le cout d'une recherche
55 55
 		 */
56 56
 		private function getCoutRecherche($cout, $niveau_recherche) {
57
-			$cout_eau = $cout["eau"] * ($this->coef_centre * $niveau_recherche);
57
+			$cout_eau = $cout["eau"]*($this->coef_centre*$niveau_recherche);
58 58
 			$cout_eau = Bataille::getTestAssezRessourceBase("eau", $cout_eau);
59 59
 			
60
-			$cout_electricite = $cout["electricite"] * ($this->coef_centre * $niveau_recherche);
60
+			$cout_electricite = $cout["electricite"]*($this->coef_centre*$niveau_recherche);
61 61
 			$cout_electricite = Bataille::getTestAssezRessourceBase("electricite", $cout_electricite);
62 62
 			
63
-			$cout_fer = $cout["fer"] * ($this->coef_centre * $niveau_recherche);
63
+			$cout_fer = $cout["fer"]*($this->coef_centre*$niveau_recherche);
64 64
 			$cout_fer = Bataille::getTestAssezRessourceBase("fer", $cout_fer);
65 65
 			
66
-			$cout_fuel = $cout["fuel"] * ($this->coef_centre * $niveau_recherche);
66
+			$cout_fuel = $cout["fuel"]*($this->coef_centre*$niveau_recherche);
67 67
 			$cout_fuel = Bataille::getTestAssezRessourceBase("fuel", $cout_fuel);
68 68
 			
69 69
 			return [
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 			$pourcent = ($temps*Bataille::getBatiment()->getNiveauBatiment("centre_recherche")/100);
84 84
 
85 85
 			if ($niveau == 0) {
86
-				return round($temps-$pourcent);;
86
+				return round($temps-$pourcent); ;
87 87
 			}
88 88
 
89
-			return round(($temps * ($this->coef_centre * $niveau))-$pourcent);
89
+			return round(($temps*($this->coef_centre*$niveau))-$pourcent);
90 90
 		}
91 91
 
92 92
 		/**
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 			$fuel = Bataille::getTestAssezRessourceBase("fuel", $cout["fuel"]["ressource"]);
257 257
 
258 258
 
259
-			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge" ) {
259
+			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge") {
260 260
 				FlashMessage::setFlash("Pas assez de ressources pour effectuer cette recherche");
261 261
 				return false;
262 262
 			}
Please login to merge, or discard this patch.
modules/bataille/app/controller/Nourriture.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		 * fonction qui renvoi la durée écoulée depuis le dernier check de la nourriture
39 39
 		 */
40 40
 		private function getLastCheckNourriture() {
41
-			$dbc= App::getDb();
41
+			$dbc = App::getDb();
42 42
 			
43 43
 			$query = $dbc->select("last_check_nourriture")->from("_bataille_infos_player")->where("ID_identite", "=", Bataille::getIdIdentite())->get();
44 44
 			
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			$nourriture_base = Bataille::getRessource()->getNourriture();
114 114
 			$nourriture_consommee = ($nb_unite*$this->getConsommationNourritureUnite())*$nb_heure;
115 115
 			
116
-			$nourriture_retirer = $nourriture_base - $nourriture_consommee;
116
+			$nourriture_retirer = $nourriture_base-$nourriture_consommee;
117 117
 			
118 118
 			if ($nourriture_retirer < 0) {
119 119
 				$unite_tuer = abs(round($nourriture_retirer/100));
Please login to merge, or discard this patch.
modules/bataille/app/controller/Ressource.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -190,11 +190,11 @@
 block discarded – undo
190 190
 
191 191
 			//soit on enelve ou on ajoute
192 192
 			if ($signe == "-") {
193
-				$eau = $this->eau - $eau;
194
-				$electricite = $this->electricite - $electricite;
195
-				$fer = $this->fer - $fer;
196
-				$fuel = $this->fuel - $fuel;
197
-				$nourriture = $this->nourriture - $nourriture;
193
+				$eau = $this->eau-$eau;
194
+				$electricite = $this->electricite-$electricite;
195
+				$fer = $this->fer-$fer;
196
+				$fuel = $this->fuel-$fuel;
197
+				$nourriture = $this->nourriture-$nourriture;
198 198
 				
199 199
 				if ($eau < 0) $eau = 0;
200 200
 				if ($electricite < 0) $electricite = 0;
Please login to merge, or discard this patch.
modules/bataille/app/controller/Batiment.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -320,13 +320,13 @@  discard block
 block discarded – undo
320 320
 			$batiment_construit = $this->getBatimentBase();
321 321
 
322 322
 			//recuperation de la liste complete des batiments
323
-			$c_all_batiment  = $this->getAllBatimentGame();
323
+			$c_all_batiment = $this->getAllBatimentGame();
324 324
 
325 325
 			//boucle qui recupere en tableau le champ pour_construire d'un batiment
326 326
 			//et compare la liste des batiments qu'il faut pour construire le batiment
327 327
 			//a ceux qui sont deja construit dans la base
328 328
 			//si tous les batments qu'il faut son batis on autorise la construction du batiment
329
-			for ($i = 0 ; $i < $c_all_batiment ; $i++) {
329
+			for ($i = 0; $i < $c_all_batiment; $i++) {
330 330
 				if (!in_array($this->all_batiment[$i], $batiment_construit)) {
331 331
 					$query = $dbc1->select("pour_construire")
332 332
 						->select("temps_construction")
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 						$ok_construction = false;
352 352
 						//test si tous les batiments sont construits et on le niveau nécéssaire
353 353
 						$count = count($pour_construire);
354
-						for ($j = 0 ; $j < $count ; $j++) {
354
+						for ($j = 0; $j < $count; $j++) {
355 355
 							if (in_array($pour_construire[$j][1], $batiment_construit)) {
356 356
 								if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) {
357 357
 									$ok_construction = true;
@@ -436,8 +436,8 @@  discard block
 block discarded – undo
436 436
 					$finx_batiment = $taille_batiment[0]+$posx_batiment;
437 437
 					$finy_batiment = $taille_batiment[1]+$posy_batiment;
438 438
 					
439
-					for ($i = $posy ; $i < $finy ; $i++) {
440
-						for ($j = $posx ; $j < $finx ; $j++) {
439
+					for ($i = $posy; $i < $finy; $i++) {
440
+						for ($j = $posx; $j < $finx; $j++) {
441 441
 							if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) {
442 442
 								FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre");
443 443
 								return false;
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
 					->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1)
593 593
 					->get();
594 594
 				
595
-				if ((is_array($query)) && (count($query) > 0)){
595
+				if ((is_array($query)) && (count($query) > 0)) {
596 596
 					foreach ($query as $obj) {
597 597
 						$this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement;
598 598
 					}
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
 			$ressource = $this->getRessourceConstruireBatiment($this->nom_batiment_sql, $this->niveau_batiment);
628 628
 			
629 629
 			//si pas assez de ressource
630
-			if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") {
630
+			if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") {
631 631
 				FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment");
632 632
 				return false;
633 633
 			}
Please login to merge, or discard this patch.