Completed
Push — feature/no_mail ( 152186 )
by Laurent
01:49
created
Http/Web/Requests/Request.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
      *
14 14
      * @return mixed
15 15
      */
16
-    public function getParam($name, $defaultValue = null){
17
-        if($_POST[$name]){
16
+    public function getParam($name, $defaultValue = null) {
17
+        if ($_POST[$name]) {
18 18
             return $_POST[$name];
19 19
         }
20 20
 
21
-        if($_GET[$name]){
21
+        if ($_GET[$name]) {
22 22
             return $_GET[$name];
23 23
         }
24 24
 
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
     /**
29 29
      * @return bool
30 30
      */
31
-    public function isPost(){
31
+    public function isPost() {
32 32
         return strtoupper($_SERVER['REQUEST_METHOD']) === 'POST';
33 33
     }
34 34
 
35 35
     /**
36 36
      * @return array
37 37
      */
38
-    public function getPostParameters(){
38
+    public function getPostParameters() {
39 39
         return $_POST;
40 40
     }
41 41
 }
42 42
\ No newline at end of file
Please login to merge, or discard this patch.
Http/Web/Form/SupplierBillSelect.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,9 +36,9 @@
 block discarded – undo
36 36
         }
37 37
 
38 38
         $sql = 'SELECT f.rowid, f.ref as ref_supplier, f.total_ttc, society.nom';
39
-        $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
40
-        $sql.= ' INNER JOIN '.MAIN_DB_PREFIX.'societe as society ON society.rowid = f.fk_soc';
41
-        $sql.= ' ORDER BY f.datec DESC';
39
+        $sql .= ' FROM ' . MAIN_DB_PREFIX . 'facture_fourn as f';
40
+        $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'societe as society ON society.rowid = f.fk_soc';
41
+        $sql .= ' ORDER BY f.datec DESC';
42 42
 
43 43
         $resql = $this->db->query($sql);
44 44
         if ($resql) {
Please login to merge, or discard this patch.
Http/Web/Form/DamageCreationForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
         return $obj;
42 42
     }
43 43
 
44
-    private function addAmount(){
44
+    private function addAmount() {
45 45
         $field = new Number('amount');
46 46
         $field->required();
47 47
         $field->setMin(1);
Please login to merge, or discard this patch.
Form/Form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
      */
88 88
     public function add(FormElementInterface $element)
89 89
     {
90
-        if(array_key_exists($element->getName(), $this->elements)){
90
+        if (array_key_exists($element->getName(), $this->elements)) {
91 91
             throw new \InvalidArgumentException('Element already exists');
92 92
         }
93 93
         $this->elements[$element->getName()] = $element;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function getErrorMessages()
143 143
     {
144
-        if(!$this->validator){
144
+        if (!$this->validator) {
145 145
             return [];
146 146
         }
147 147
 
Please login to merge, or discard this patch.
class/Common/ValueObject/Id.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      *
25 25
      * @return Id
26 26
      */
27
-    public static function create($id){
27
+    public static function create($id) {
28 28
         return new self($id);
29 29
     }
30 30
 
Please login to merge, or discard this patch.
class/card/TabCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      * @return array
54 54
      */
55 55
     public function toArray() {
56
-        return array_map(function(Tab $tab){
56
+        return array_map(function(Tab $tab) {
57 57
             return $tab->toArray();
58 58
         }, $this->tabs);
59 59
     }
Please login to merge, or discard this patch.
query/BillableFlightQueryHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         //Total damages
147 147
         $damages = $this->pilotDamageQueryRepository->query($query->getFiscalYear());
148
-        foreach($damages as $currentDamage){
148
+        foreach ($damages as $currentDamage) {
149 149
 
150 150
             //Pilot doesn't exist
151 151
             if (!isset($pilots[$currentDamage->getAuthorId()])) {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             );
159 159
 
160 160
             // The damage is already invoiced. So not take into account.
161
-            if($currentDamage->isInvoiced()){
161
+            if ($currentDamage->isInvoiced()) {
162 162
                 $pilots[$currentDamage->getAuthorId()] = $pilots[$currentDamage->getAuthorId()]->addCount(
163 163
                     new FlightTypeCount('invoiced_damage', $currentDamage->getAmount(), -1)
164 164
                 );
Please login to merge, or discard this patch.
readFlights.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
     print '<td>' . $pilot->getCountForType('orga_T6')->getCount() . '</td>';
231 231
     print '<td>' . $pilot->getCountForType('orga_T6')->getCost()->getValue() . '</td>';
232 232
 
233
-    print sprintf('<td class="%s">', $pilot->getFlightBonus()->getValue() === 0?'text-muted':'text-bold'). $pilot->getFlightBonus()->getValue() . ' pts</td>';
233
+    print sprintf('<td class="%s">', $pilot->getFlightBonus()->getValue() === 0 ? 'text-muted' : 'text-bold') . $pilot->getFlightBonus()->getValue() . ' pts</td>';
234 234
 
235 235
     print '<td>' . $pilot->getCountForType('3')->getCount() . '</td>';
236 236
     print '<td>' . price($pilot->getCountForType('3')->getCost()->getValue()) . '€</td>';
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
     print '<td>' . price($pilot->getCountForType('damage')->getCost()->getValue()) . '€</td>';
250 250
     print '<td>' . price($pilot->getCountForType('invoiced_damage')->getCost()->getValue()) . '€</td>';
251 251
 
252
-    print sprintf('<td class="%s">', $pilot->getFlightsCost()->getValue() === 0?'text-muted':'text-bold'). price($pilot->getFlightsCost()->getValue()) . '€ </td>';
253
-    print sprintf('<td class="%s">', $pilot->isBillable(FlightBonus::zero())?'text-bold':'text-muted'). price($pilot->getTotalBill()->getValue()) . '€</td>';
252
+    print sprintf('<td class="%s">', $pilot->getFlightsCost()->getValue() === 0 ? 'text-muted' : 'text-bold') . price($pilot->getFlightsCost()->getValue()) . '€ </td>';
253
+    print sprintf('<td class="%s">', $pilot->isBillable(FlightBonus::zero()) ? 'text-bold' : 'text-muted') . price($pilot->getTotalBill()->getValue()) . '€</td>';
254 254
     print '</tr>';
255 255
 }
256 256
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 print '<td>' . $totalT3 . '</td>';
276 276
 print '<td></td>';
277 277
 
278
-print '<td>' . $totalT4. '</td>';
278
+print '<td>' . $totalT4 . '</td>';
279 279
 print '<td></td>';
280 280
 
281 281
 print '<td>' . $totalT5 . '</td>';
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 //table km
305 305
 $tauxRemb = isset($conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM) ? $conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM : 0;
306 306
 $year = GETPOST("year", 'int');
307
-if(empty($year)){
307
+if (empty($year)) {
308 308
     $year = date('Y');
309 309
 }
310 310
 
Please login to merge, or discard this patch.
Infrastructure/Damage/Query/Repository/GetPilotDamagesQueryRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -35,16 +35,16 @@
 block discarded – undo
35 35
     public function query($year)
36 36
     {
37 37
         $sql = 'SELECT damage.amount as amount, damage.billed as billed, damage.author_id as author, author.firstname as author_name';
38
-        $sql.=' FROM '.MAIN_DB_PREFIX.'bbc_flight_damages as damage';
39
-        $sql.=' INNER JOIN '.MAIN_DB_PREFIX.'bbc_vols as flight ON flight.rowid = damage.flight_id';
40
-        $sql.=' INNER JOIN '.MAIN_DB_PREFIX.'user as author ON author.rowid = damage.author_id';
41
-        $sql.=' WHERE YEAR(flight.date) = '.$this->db->escape($year);
38
+        $sql .= ' FROM ' . MAIN_DB_PREFIX . 'bbc_flight_damages as damage';
39
+        $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'bbc_vols as flight ON flight.rowid = damage.flight_id';
40
+        $sql .= ' INNER JOIN ' . MAIN_DB_PREFIX . 'user as author ON author.rowid = damage.author_id';
41
+        $sql .= ' WHERE YEAR(flight.date) = ' . $this->db->escape($year);
42 42
 
43 43
         $resql = $this->db->query($sql);
44 44
         if ($resql) {
45 45
             $num = $this->db->num_rows($resql);
46 46
             if ($num) {
47
-                for($i = 0; $i < $num ; $i++) {
47
+                for ($i = 0; $i < $num; $i++) {
48 48
                     $properties = $this->db->fetch_array($resql);
49 49
                     $damage = TotalDamage::fromArray($properties);
50 50
                     yield $damage;
Please login to merge, or discard this patch.