Passed
Push — master ( fd8de5...e83663 )
by Anthony
02:23
created
modules/messagerie/app/controller/Messagerie.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 			return $this->message;
77 77
 		}
78 78
 		public function getDateMessage(){
79
-		    return $this->date_message;
79
+			return $this->date_message;
80 80
 		}
81 81
 		public function getUrl(){
82
-		    return $this->url;
82
+			return $this->url;
83 83
 		}
84 84
 		public function getIdExpediteur() {
85 85
 			return $this->id_expediteur;
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 			return $this->pseudo_receveur;
95 95
 		}
96 96
 		public function getValues(){
97
-		    return ["messagerie" => $this->values];
97
+			return ["messagerie" => $this->values];
98 98
 		}
99 99
 
100 100
 		/**
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 		public function getMessage() {
77 77
 			return $this->message;
78 78
 		}
79
-		public function getDateMessage(){
79
+		public function getDateMessage() {
80 80
 		    return $this->date_message;
81 81
 		}
82
-		public function getUrl(){
82
+		public function getUrl() {
83 83
 		    return $this->url;
84 84
 		}
85 85
 		public function getIdExpediteur() {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		public function getPseudoReceveur() {
95 95
 			return $this->pseudo_receveur;
96 96
 		}
97
-		public function getValues(){
97
+		public function getValues() {
98 98
 		    return ["messagerie" => $this->values];
99 99
 		}
100 100
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 				$destinataires = explode(",", $destinataire);
292 292
 				$c = count($destinataires);
293 293
 
294
-				for ($i=0 ; $i<$c ; $i++) {
294
+				for ($i = 0; $i < $c; $i++) {
295 295
 					if ($this->getIdIdentiteExist($destinataires[$i]) !== false) {
296 296
 						$destinataires[] = $this->getIdIdentiteExist($destinataires[$i]);
297 297
 					}
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 		public function getMessage() {
77 77
 			return $this->message;
78 78
 		}
79
-		public function getDateMessage(){
79
+		public function getDateMessage() {
80 80
 		    return $this->date_message;
81 81
 		}
82
-		public function getUrl(){
82
+		public function getUrl() {
83 83
 		    return $this->url;
84 84
 		}
85 85
 		public function getIdExpediteur() {
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 		public function getPseudoReceveur() {
95 95
 			return $this->pseudo_receveur;
96 96
 		}
97
-		public function getValues(){
97
+		public function getValues() {
98 98
 		    return ["messagerie" => $this->values];
99 99
 		}
100 100
 
Please login to merge, or discard this patch.
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/Marche.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
 		}
190 190
 		
191 191
 		/**
192
-		 * @param $date_retour
192
+		 * @param double $date_retour
193 193
 		 * fonction qui place le trajet en retour
194 194
 		 */
195 195
 		private function setTrajetRetour($date_retour) {
Please login to merge, or discard this patch.
modules/bataille/app/controller/Batiment.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 			//et compare la liste des batiments qu'il faut pour construire le batiment
306 306
 			//a ceux qui sont deja construit dans la base
307 307
 			//si tous les batments qu'il faut son batis on autorise la construction du batiment
308
-			for ($i = 0 ; $i < $c_all_batiment ; $i++) {
308
+			for ($i = 0; $i < $c_all_batiment; $i++) {
309 309
 				if (!in_array($all_batiment[$i], $batiment_construit)) {
310 310
 					$query = $dbc1->select("pour_construire")
311 311
 						->select("temps_construction")
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 					else if (count($pour_construire) > 1) {
348 348
 						$ok_construction = false;
349 349
 						//test si tous les batiments sont construits et on le niveau nécéssaire
350
-						for ($j = 0 ; $j < count($pour_construire) ; $j++) {
350
+						for ($j = 0; $j < count($pour_construire); $j++) {
351 351
 							if (in_array($pour_construire[$j][1], $batiment_construit)) {
352 352
 								if ($pour_construire[$j][2] <= $this->getNiveauBatiment($pour_construire[$j][1])) {
353 353
 									$ok_construction = true;
@@ -434,8 +434,8 @@  discard block
 block discarded – undo
434 434
 					$finx_batiment = $taille_batiment[0]+$posx_batiment;
435 435
 					$finy_batiment = $taille_batiment[1]+$posy_batiment;
436 436
 					
437
-					for ($i = $posy ; $i < $finy ; $i++) {
438
-						for ($j = $posx ; $j < $finx ; $j++) {
437
+					for ($i = $posy; $i < $finy; $i++) {
438
+						for ($j = $posx; $j < $finx; $j++) {
439 439
 							if ((($posx++ >= $posx_batiment) && ($posx++ <= $finx_batiment)) && (($posy++ >= $posy_batiment) && ($posy++ <= $finy_batiment))) {
440 440
 								FlashMessage::setFlash("Un batiment est déjà présent à cet emplacement, merci d'en choisir un autre");
441 441
 								return false;
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 						->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1)
566 566
 						->get();
567 567
 
568
-					if ((is_array($query)) && (count($query) > 0)){
568
+					if ((is_array($query)) && (count($query) > 0)) {
569 569
 						foreach ($query as $obj) {
570 570
 							$this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement;
571 571
 						}
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 				}
618 618
 
619 619
 				//si pas assez de ressource
620
-				if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] ||$ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") {
620
+				if (($ressource["eau"]["class"] || $ressource["electricite"]["class"] || $ressource["fer"]["class"] || $ressource["fuel"]["class"]) == "rouge") {
621 621
 					FlashMessage::setFlash("Pas assez de ressources pour construire ce batiment");
622 622
 					return false;
623 623
 				}
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -565,7 +565,7 @@
 block discarded – undo
565 565
 						->where("ID_".$this->nom_batiment_sql, "=", $this->niveau_batiment+1)
566 566
 						->get();
567 567
 
568
-					if ((is_array($query)) && (count($query) > 0)){
568
+					if ((is_array($query)) && (count($query) > 0)) {
569 569
 						foreach ($query as $obj) {
570 570
 							$this->info_batiment_next = $xml->$nom_batiment_sql->phrase_suivant.$obj->$champ.$xml->$nom_batiment_sql->complement;
571 571
 						}
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/CentreRecherche.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
 		 * fonction qui renvoi le cout d'une recherche
61 61
 		 */
62 62
 		private function getCoutRecherche($cout, $niveau_recherche) {
63
-			$cout_eau = $cout["eau"] * ($this->coef_centre * $niveau_recherche);
63
+			$cout_eau = $cout["eau"]*($this->coef_centre*$niveau_recherche);
64 64
 			$cout_eau = Bataille::getTestAssezRessourceBase("eau", $cout_eau);
65 65
 			
66
-			$cout_electricite = $cout["electricite"] * ($this->coef_centre * $niveau_recherche);
66
+			$cout_electricite = $cout["electricite"]*($this->coef_centre*$niveau_recherche);
67 67
 			$cout_electricite = Bataille::getTestAssezRessourceBase("electricite", $cout_electricite);
68 68
 			
69
-			$cout_fer = $cout["fer"] * ($this->coef_centre * $niveau_recherche);
69
+			$cout_fer = $cout["fer"]*($this->coef_centre*$niveau_recherche);
70 70
 			$cout_fer = Bataille::getTestAssezRessourceBase("fer", $cout_fer);
71 71
 			
72
-			$cout_fuel = $cout["fuel"] * ($this->coef_centre * $niveau_recherche);
72
+			$cout_fuel = $cout["fuel"]*($this->coef_centre*$niveau_recherche);
73 73
 			$cout_fuel = Bataille::getTestAssezRessourceBase("fuel", $cout_fuel);
74 74
 			
75 75
 			return [
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
 			$pourcent = ($temps*Bataille::getBatiment()->getNiveauBatiment("centre_recherche")/100);
90 90
 
91 91
 			if ($niveau == 0) {
92
-				return round($temps-$pourcent);;
92
+				return round($temps-$pourcent); ;
93 93
 			}
94 94
 
95
-			return round(($temps * ($this->coef_centre * $niveau))-$pourcent);
95
+			return round(($temps*($this->coef_centre*$niveau))-$pourcent);
96 96
 		}
97 97
 
98 98
 		/**
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 			$fuel = Bataille::getTestAssezRessourceBase("fuel", $cout["fuel"]);
260 260
 
261 261
 
262
-			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge" ) {
262
+			if (($eau["class"] || $electricite["class"] || $fer["class"] || $fuel["class"]) == "rouge") {
263 263
 				FlashMessage::setFlash("Pas assez de ressources pour effectuer cette recherche");
264 264
 				return false;
265 265
 			}
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/bataille/app/controller/Nourriture.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
 		}
103 103
 		
104 104
 		/**
105
-		 * @param $nb_heure
105
+		 * @param double $nb_heure
106 106
 		 * @param $nb_unite
107 107
 		 * fonction qui calcule la nourriture consomee en 1h
108 108
 		 * si elle est inférieur à 0 on tue un nombre d'unite defini en fonction de combien le nombre de
Please login to merge, or discard this 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_last_connexion")->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.