Passed
Push — master ( 341095...d27ad8 )
by Anthony
02:56
created
modules/bataille/app/controller/marche/envoyer_ressources.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-	$marche =  new \modules\bataille\app\controller\Marche();
2
+	$marche = new \modules\bataille\app\controller\Marche();
3 3
 
4 4
 	$marche->setCommencerTransport($_POST['eau'], $_POST['electricite'], $_POST['fer'], $_POST['fuel'], $_POST['nourriture'], $_POST['posx'], $_POST['posy']);
5 5
 
Please login to merge, or discard this patch.
modules/bataille/app/controller/Marche.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 			echo $this->date_arrivee."<br>";
59 59
 
60 60
 			//on test si déja arrivé à destination
61
-			if (($this->aller == 1) && (($this->date_arrivee-$today) <= 0)) {
61
+			if (($this->aller == 1) && (($this->date_arrivee - $today) <= 0)) {
62 62
 				$this->setLivrerRessource();
63 63
 
64 64
 				//on calcul la date d'arrivée du retour
65
-				$date_retour = Bataille::getDureeTrajet($this->id_base_dest)+$this->date_arrivee;
65
+				$date_retour = Bataille::getDureeTrajet($this->id_base_dest) + $this->date_arrivee;
66 66
 
67 67
 				//si le retour du trajet est également arrivé on finit le transport sinon on le place sur le retour
68 68
 				if ($date_retour < $today) {
@@ -70,15 +70,15 @@  discard block
 block discarded – undo
70 70
 				}
71 71
 				else {
72 72
 					$this->setTrajetRetour($date_retour);
73
-					$this->duree_restante_trajet = $date_retour-$today;
73
+					$this->duree_restante_trajet = $date_retour - $today;
74 74
 					$set_array = true;
75 75
 				}
76 76
 			}
77
-			else if (($this->aller == 0) && (($this->date_arrivee-$today) <= 0)) {
77
+			else if (($this->aller == 0) && (($this->date_arrivee - $today) <= 0)) {
78 78
 				$this->setTerminerTransport();
79 79
 			}
80 80
 			else {
81
-				$this->duree_restante_trajet = $this->date_arrivee-$today;
81
+				$this->duree_restante_trajet = $this->date_arrivee - $today;
82 82
 				$set_array = true;
83 83
 			}
84 84
 
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 			}
129 129
 
130 130
 			//on a le nombre de marchand dispo dans la base
131
-			$nombre_marchand_dispo = $nombre_max_marchand-$marchand_transport;
131
+			$nombre_marchand_dispo = $nombre_max_marchand - $marchand_transport;
132 132
 
133 133
 			//on calcul savoir si on en a assez pour transport toutes les ressoures
134 134
 			//il faut 1 marchand pour 1000 ressource
135
-			$nombre_marchand_trajet = ceil($all_ressource/1000);
135
+			$nombre_marchand_trajet = ceil($all_ressource / 1000);
136 136
 
137 137
 			//si on a assez de marchand on revoi true sinon false
138 138
 			if ($nombre_marchand_dispo >= $nombre_marchand_trajet) {
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 				}
214 214
 
215 215
 				//on check si assez marchand dans la base, si pas assez on return false
216
-				$nb_marchand = $this->getAssezMarchand($eau+$electricite+$fer+$fuel+$nourriture);
216
+				$nb_marchand = $this->getAssezMarchand($eau + $electricite + $fer + $fuel + $nourriture);
217 217
 
218 218
 				if ($nb_marchand === false) {
219 219
 					FlashMessage::setFlash("Vous n'avez pas assez de marchans disponibles pour effectuer ce trajet");
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
 				//sinon initialise le transport
224 224
 				//on recup la date d'arrivee dans la base de destintation
225
-				$date_arrivee = Bataille::getDureeTrajet($id_base_dest)+Bataille::getToday();
225
+				$date_arrivee = Bataille::getDureeTrajet($id_base_dest) + Bataille::getToday();
226 226
 
227 227
 				$ressource = [
228 228
 					"eau" => $eau,
Please login to merge, or discard this patch.