Passed
Push — master ( 5c42a2...3713ac )
by Anthony
04:32
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.
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.
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/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/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 2 patches
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.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 		//-------------------------- SETTER ----------------------------------------------------------------------------//
80 80
 		/**
81 81
 		 * @param $id_base
82
-		 * @param null $type
82
+		 * @param string $type
83 83
 		 * @param null $points
84 84
 		 * @return int|null
85 85
 		 * fonction qui ajoute des points à la base en fonction du type
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_base")
44 44
 				->where("ID_identite", "=", Bataille::getIdIdentite(), "AND")
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 			$nourriture_base = Bataille::getRessource()->getNourriture();
120 120
 			$nourriture_consommee = ($nb_unite*$this->getConsommationNourritureUnite())*$nb_heure;
121 121
 			
122
-			$nourriture_retirer = $nourriture_base - $nourriture_consommee;
122
+			$nourriture_retirer = $nourriture_base-$nourriture_consommee;
123 123
 			
124 124
 			if ($nourriture_retirer < 0) {
125 125
 				$unite_tuer = abs(round($nourriture_retirer/100));
Please login to merge, or discard this patch.
modules/bataille/app/controller/GenerationRapport.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -19,6 +19,11 @@
 block discarded – undo
19 19
 		
20 20
 		
21 21
 		//-------------------------- SETTER ----------------------------------------------------------------------------//
22
+
23
+		/**
24
+		 * @param string $titre
25
+		 * @param string $type
26
+		 */
22 27
 		public static function setGenererRapport($titre, $infos, $type) {
23 28
 			$chemin = MODULEROOT."bataille/app/controller/rapports/";
24 29
 			
Please login to merge, or discard this patch.
modules/bataille/app/controller/Ressource.php 2 patches
Doc Comments   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 		}
72 72
 		
73 73
 		/**
74
-		 * @param $ressource
74
+		 * @param string $ressource
75 75
 		 * @return string
76 76
 		 * fonction qui sert à tester si on a atteint le stockage maximum pour une ressource en particulier
77 77
 		 */
@@ -89,8 +89,7 @@  discard block
 block discarded – undo
89 89
 		}
90 90
 		
91 91
 		/**
92
-		 * @param null $id_base -> sert si definit a recuperer l'id identite de la abse en question
93
-		 * recupere la date de la derniere connexion
92
+		 * @return string|null
94 93
 		 */
95 94
 		private function getLastConnexion() {
96 95
 			$dbc = App::getDb();
@@ -147,9 +146,9 @@  discard block
 block discarded – undo
147 146
 		}
148 147
 
149 148
 		/**
150
-		 * @param $nom_ressource
149
+		 * @param string $nom_ressource
151 150
 		 * @param $ressrouce
152
-		 * @param $diff_temps
151
+		 * @param integer $diff_temps
153 152
 		 * fonction qui ajoute les ressources qu'on a eu dans la base et qui reinitialise la last co a now
154 153
 		 */
155 154
 		private function setAddRessource($nom_ressource, $ressrouce, $diff_temps) {
@@ -182,7 +181,7 @@  discard block
 block discarded – undo
182 181
 		 * @param $fer
183 182
 		 * @param $fuel
184 183
 		 * @param $nourriture
185
-		 * @param $signe -> contient + ou -
184
+		 * @param string $signe -> contient + ou -
186 185
 		 * fonction qui permet de retirer des ressources pour construire des batiment ou creer unités
187 186
 		 */
188 187
 		public function setUpdateRessource($eau, $electricite, $fer, $fuel, $nourriture, $signe) {
Please login to merge, or discard this 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.