@@ -7,8 +7,7 @@ |
||
| 7 | 7 | |
| 8 | 8 | if ($validator->getErrors() !== null) { |
| 9 | 9 | \core\HTML\flashmessage\FlashMessage::setFlash($validator->getErrors()); |
| 10 | - } |
|
| 11 | - else { |
|
| 10 | + } else { |
|
| 12 | 11 | $type = $_POST["type"]; |
| 13 | 12 | $objet = $_POST['objet']." de la part de ".$_SERVER['HTTP_HOST']; |
| 14 | 13 | $demande = $_POST['demande']; |
@@ -87,19 +87,19 @@ |
||
| 87 | 87 | * renvoi le ou les batiments nécéssaires pour la construction du batiment spécifié |
| 88 | 88 | */ |
| 89 | 89 | private function getPourConstruire($pour_construire) { |
| 90 | - for ($i=0 ; $i<count($pour_construire) ; $i++) { |
|
| 90 | + for ($i = 0; $i < count($pour_construire); $i++) { |
|
| 91 | 91 | //si plusieur batiment pour construire le batiment en question |
| 92 | 92 | $count = count($pour_construire[$i]); |
| 93 | 93 | if ($count > 1) { |
| 94 | - for ($j=0 ; $j<$count ; $j++) { |
|
| 95 | - $batiment[] = [ |
|
| 94 | + for ($j = 0; $j < $count; $j++) { |
|
| 95 | + $batiment[] = [ |
|
| 96 | 96 | "nom_batiment" => $pour_construire[$i][$j][0], |
| 97 | 97 | "niveau_batiment" => $pour_construire[$i][$j][2] |
| 98 | 98 | ]; |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | else { |
| 102 | - $batiment[] = [ |
|
| 102 | + $batiment[] = [ |
|
| 103 | 103 | "nom_batiment" => $pour_construire[$i][0][0], |
| 104 | 104 | "niveau_batiment" => $pour_construire[$i][0][2] |
| 105 | 105 | ]; |
@@ -43,8 +43,7 @@ discard block |
||
| 43 | 43 | $pour_construire[] = unserialize($obj->pour_construire); |
| 44 | 44 | |
| 45 | 45 | $pour_construire = $this->getPourConstruire($pour_construire); |
| 46 | - } |
|
| 47 | - else { |
|
| 46 | + } else { |
|
| 48 | 47 | $pour_construire = []; |
| 49 | 48 | } |
| 50 | 49 | |
@@ -97,8 +96,7 @@ discard block |
||
| 97 | 96 | "niveau_batiment" => $pour_construire[$i][$j][2] |
| 98 | 97 | ]; |
| 99 | 98 | } |
| 100 | - } |
|
| 101 | - else { |
|
| 99 | + } else { |
|
| 102 | 100 | $batiment[] = [ |
| 103 | 101 | "nom_batiment" => $pour_construire[$i][0][0], |
| 104 | 102 | "niveau_batiment" => $pour_construire[$i][0][2] |
@@ -30,8 +30,7 @@ |
||
| 30 | 30 | |
| 31 | 31 | if (((is_array($query)) && (count($query) > 0)) || ($controller !== false)) { |
| 32 | 32 | return true; |
| 33 | - } |
|
| 34 | - else { |
|
| 33 | + } else { |
|
| 35 | 34 | $router = new RouterModule(); |
| 36 | 35 | |
| 37 | 36 | if ($router->getRouteModuleExist($url) !== true) { |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | //-------------------------- SETTER ----------------------------------------------------------------------------// |
| 50 | 50 | /** |
| 51 | 51 | * @param $id_base |
| 52 | - * @param $type |
|
| 52 | + * @param string $type |
|
| 53 | 53 | * fonction qui ajoute des points à la base en fonction du type |
| 54 | 54 | * le type peut etre : batiment, attaque, defense, troupe |
| 55 | 55 | */ |
@@ -41,7 +41,9 @@ |
||
| 41 | 41 | |
| 42 | 42 | $query = $dbc->select("points_batiment")->from("configuration")->where("ID_configuration", "=", 1)->get(); |
| 43 | 43 | |
| 44 | - foreach ($query as $obj) return $obj->points_batiment; |
|
| 44 | + foreach ($query as $obj) { |
|
| 45 | + return $obj->points_batiment; |
|
| 46 | + } |
|
| 45 | 47 | } |
| 46 | 48 | //-------------------------- END GETTER ----------------------------------------------------------------------------// |
| 47 | 49 | |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $dbc = App::getDb(); |
| 58 | 58 | |
| 59 | 59 | if ($type == "batiment") { |
| 60 | - $points = self::getPointsBase($id_base)+self::getPointAjoutBatiment(); |
|
| 60 | + $points = self::getPointsBase($id_base) + self::getPointAjoutBatiment(); |
|
| 61 | 61 | |
| 62 | 62 | } |
| 63 | 63 | |