Completed
Push — feature/select_existing_custom... ( a1e51a )
by Laurent
01:57
created
class/missions/PilotMissions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         Assert::nullOrString($pilotLastname);
47 47
         Assert::nullOrString($pilotFirstname);
48 48
 
49
-        $this->pilotId = (int)$pilotId;
49
+        $this->pilotId = (int) $pilotId;
50 50
         $this->pilotFirstname = $pilotFirstname;
51 51
         $this->pilotLastname = $pilotLastname;
52 52
 
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
      * @param int $numberOfFlights
60 60
      * @param int $numberOfKilometers
61 61
      */
62
-    public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers){
62
+    public function addQuarter($quarter, $numberOfFlights, $numberOfKilometers) {
63 63
         Assert::integerish($quarter);
64
-        $quarter = (int)$quarter;
64
+        $quarter = (int) $quarter;
65 65
 
66 66
         Assert::keyNotExists($this->quarterMissions, $quarter);
67 67
 
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
      *
120 120
      * @return QuarterMission
121 121
      */
122
-    private function getQuarterMission($quarter){
122
+    private function getQuarterMission($quarter) {
123 123
         Assert::integer($quarter);
124 124
         Assert::greaterThan($quarter, 0);
125 125
         Assert::lessThanEq($quarter, 4);
126 126
 
127
-        if(!isset($this->quarterMissions[$quarter])){
128
-            return new QuarterMission($quarter,0,0);
127
+        if (!isset($this->quarterMissions[$quarter])) {
128
+            return new QuarterMission($quarter, 0, 0);
129 129
         }
130 130
 
131 131
         return $this->quarterMissions[$quarter];
@@ -136,6 +136,6 @@  discard block
 block discarded – undo
136 136
      */
137 137
     public function getPilotName()
138 138
     {
139
-        return $this->pilotFirstname.' '.$this->pilotLastname;
139
+        return $this->pilotFirstname . ' ' . $this->pilotLastname;
140 140
     }
141 141
 }
142 142
\ No newline at end of file
Please login to merge, or discard this patch.
generateExpenseNote.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
     try {
88 88
         $command = new CreateExpenseNoteCommand($year, $quarter, $userValidatorId, $privateNote, $publicNote);
89 89
         $commandHandler->__invoke($command);
90
-    } catch(PeriodNotFinishedException $e){
90
+    } catch (PeriodNotFinishedException $e) {
91 91
         dol_htmloutput_errors("Le quadri n'est pas encore fini !");
92
-    } catch(\Exception $e){
92
+    } catch (\Exception $e) {
93 93
         dol_syslog($e->getMessage(), LOG_ERR);
94 94
         dol_htmloutput_errors('Error : ' . $e->getMessage());
95 95
     }
@@ -105,15 +105,15 @@  discard block
 block discarded – undo
105 105
 $form = new Form($db);
106 106
 
107 107
 $tabLinks = [];
108
-foreach($flightYears as $currentFlightYear){
108
+foreach ($flightYears as $currentFlightYear) {
109 109
     $tabLinks[] = [
110
-        DOL_URL_ROOT."/flightlog/generateExpenseNote.php?year=".$currentFlightYear,
110
+        DOL_URL_ROOT . "/flightlog/generateExpenseNote.php?year=" . $currentFlightYear,
111 111
         $currentFlightYear,
112
-        "tab_".$currentFlightYear
112
+        "tab_" . $currentFlightYear
113 113
     ];
114 114
 }
115 115
 
116
-dol_fiche_head($tabLinks, "tab_".$year);
116
+dol_fiche_head($tabLinks, "tab_" . $year);
117 117
 
118 118
 ?>
119 119
     <form method="POST">
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         <select name="quarter" id="field_quarter">
135 135
             <option value="1" <?= ($year == $currentYear && $currentQuarter <= 1) ? 'disabled="disabled"' : "" ?>>1</option>
136 136
             <option value="2" <?= ($year == $currentYear && $currentQuarter <= 2) ? 'disabled="disabled"' : "" ?>>2</option>
137
-            <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"': "" ?>>3</option>
137
+            <option value="3" <?= ($year == $currentYear && $currentQuarter <= 3) ? 'disabled="disabled"' : "" ?>>3</option>
138 138
             <option value="4" <?= ($year == $currentYear && $currentQuarter <= 4) ? 'disabled="disabled"' : "" ?>>4</option>
139 139
         </select>
140 140
         <br/>
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         <label><?= $langs->trans("Validateur de la note de frais")?></label><br/>
144 144
         <?php
145 145
             $include_users = $object->fetch_users_approver_expensereport();
146
-            print $form->select_dolusers($user->id,"fk_user_validator",1,"",0,$include_users);
146
+            print $form->select_dolusers($user->id, "fk_user_validator", 1, "", 0, $include_users);
147 147
         ?>
148 148
         <br/>
149 149
 
Please login to merge, or discard this patch.
readFlights.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 print '<td>' . $totalT3 . '</td>';
267 267
 print '<td></td>';
268 268
 
269
-print '<td>' . $totalT4. '</td>';
269
+print '<td>' . $totalT4 . '</td>';
270 270
 print '<td></td>';
271 271
 
272 272
 print '<td>' . $totalT5 . '</td>';
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 //table km
293 293
 $tauxRemb = isset($conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM) ? $conf->global->BBC_FLIGHT_LOG_TAUX_REMB_KM : 0;
294 294
 $year = GETPOST("year", 'int');
295
-if(empty($year)){
295
+if (empty($year)) {
296 296
     $year = date('Y');
297 297
 }
298 298
 
Please login to merge, or discard this patch.
lib/flightLog.lib.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 }
109 109
 
110 110
 /**
111
- * @param null $year
111
+ * @param integer $year
112 112
  * @param null $pilotId
113 113
  * @param null $quarter
114 114
  * @param bool $groupBy
Please login to merge, or discard this patch.
command/CreateFlightBillCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
             throw new \InvalidArgumentException('Model document is missing');
92 92
         }
93 93
 
94
-        if(!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax){
94
+        if (!isset($nbrPax) || !is_numeric($nbrPax) || $nbrPax != (int) $nbrPax) {
95 95
             throw new \InvalidArgumentException('The number of pax is not correct, an integer is expected');
96 96
         }
97 97
 
Please login to merge, or discard this patch.
command/CreateFlightBillCommandHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
     {
113 113
         $customer = new Client($this->db);
114 114
 
115
-        if($flight->fk_receiver) {
115
+        if ($flight->fk_receiver) {
116 116
             return $this->fetchCustomerFromFlight($flight);
117 117
         }
118 118
 
Please login to merge, or discard this patch.
facture.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -124,11 +124,11 @@
 block discarded – undo
124 124
  * Put here all code to do according to value of "action" parameter
125 125
  */
126 126
 if ($action == EXPENSE_REPORT_GENERATOR_ACTION_GENERATE) {
127
-    try{
128
-        $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax);
127
+    try {
128
+        $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote, $bankAccount, $nbrPax);
129 129
         $handler->handle($command);
130
-    }catch (\Exception $e){
131
-        dol_syslog($e->getMessage(),LOG_ERR);
130
+    } catch (\Exception $e) {
131
+        dol_syslog($e->getMessage(), LOG_ERR);
132 132
         dol_htmloutput_mesg("Facture non créée", '', 'error');
133 133
     }
134 134
 }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     try{
128 128
         $command = new CreateFlightBillCommand($flight->getId(), $modeReglement, $conditionReglement, $documentModel, $type, $publicNote, $privateNote,$bankAccount, $nbrPax);
129 129
         $handler->handle($command);
130
-    }catch (\Exception $e){
130
+    } catch (\Exception $e){
131 131
         dol_syslog($e->getMessage(),LOG_ERR);
132 132
         dol_htmloutput_mesg("Facture non créée", '', 'error');
133 133
     }
@@ -268,9 +268,12 @@  discard block
 block discarded – undo
268 268
 
269 269
         <?php if (!$flightProduct || !$flight->hasReceiver()) : ?>
270 270
             <a class="butActionRefused" href="#">Générer</a>
271
-        <?php else: ?>
271
+        <?php else {
272
+    : ?>
272 273
             <button class="butAction" type="submit">Générer</button>
273
-        <?php endif; ?>
274
+        <?php endif;
275
+}
276
+?>
274 277
 
275 278
         <a class="butAction" href="<?php echo DOL_URL_ROOT . '/flightlog/card.php?id=' . $flight->id; ?>">Retour au
276 279
             vol</a>
Please login to merge, or discard this patch.
class/bbctypes.class.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -645,7 +645,7 @@
 block discarded – undo
645 645
     }
646 646
 
647 647
     /**
648
-     * @return array|BbctypesLine[]
648
+     * @return BbctypesLine[]
649 649
      */
650 650
     public function getLines()
651 651
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -733,7 +733,7 @@
 block discarded – undo
733 733
      */
734 734
     public function getActive()
735 735
     {
736
-        return (boolean)$this->active;
736
+        return (boolean) $this->active;
737 737
     }
738 738
 
739 739
     /**
Please login to merge, or discard this patch.
Form/Form.php 1 patch
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,6 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
     /**
97 97
      * @inheritDoc
98
+     * @param string $fieldName
98 99
      */
99 100
     public function remove($fieldName)
100 101
     {
@@ -142,7 +143,7 @@  discard block
 block discarded – undo
142 143
     }
143 144
 
144 145
     /**
145
-     * @param null|\ValidatorInterface $validator
146
+     * @param ValidatorInterface $validator
146 147
      *
147 148
      * @return Form
148 149
      */
Please login to merge, or discard this patch.