@@ -32,7 +32,7 @@ |
||
32 | 32 | // enable them everywhere with -e and mask them instead |
33 | 33 | $input = str_replace( |
34 | 34 | ['\a', '\b', '\c', '\e', '\f', '\n', '\r', '\t', '\v'], |
35 | - [ '\\\a', '\\\b', '\\\c', '\\\e', '\\\f', '\\\n', '\\\r', '\\\t', '\\\v'], |
|
35 | + ['\\\a', '\\\b', '\\\c', '\\\e', '\\\f', '\\\n', '\\\r', '\\\t', '\\\v'], |
|
36 | 36 | $input |
37 | 37 | ); |
38 | 38 | exec(sprintf('echo -e %s | php -l', escapeshellarg($input)) . " 2>&1", $parse_results, $return_status); |
@@ -74,7 +74,7 @@ |
||
74 | 74 | ]); |
75 | 75 | } |
76 | 76 | |
77 | - if ( midcom::get()->config->get('midcom_services_rcs_enable') |
|
77 | + if (midcom::get()->config->get('midcom_services_rcs_enable') |
|
78 | 78 | && $object->can_do('midgard:update') |
79 | 79 | && $object->_use_rcs) { |
80 | 80 | $buttons[] = [ |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $this->calculate_price(false); |
70 | 70 | |
71 | - if ( $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
71 | + if ($this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION |
|
72 | 72 | && $this->continuous) { |
73 | 73 | $this->end = 0; |
74 | 74 | } elseif ($this->end < $this->start) { |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $calculator->run($this); |
130 | 130 | $cost = $calculator->get_cost(); |
131 | 131 | $price = $calculator->get_price(); |
132 | - if ( $price != $this->price |
|
132 | + if ($price != $this->price |
|
133 | 133 | || $cost != $this->cost) { |
134 | 134 | $this->price = $price; |
135 | 135 | $this->cost = $cost; |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $units = $hours['invoiceable']; |
170 | 170 | $uninvoiceableUnits = $hours['reported'] - ($hours['invoiceable'] + $hours['invoiced']); |
171 | 171 | |
172 | - if ( $units != $this->units |
|
172 | + if ($units != $this->units |
|
173 | 173 | || $uninvoiceableUnits != $this->uninvoiceableUnits) { |
174 | 174 | debug_add("agreement values have changed, setting units to " . $units . ", uninvoiceable: " . $uninvoiceableUnits); |
175 | 175 | $this->units = $units; |
@@ -221,11 +221,11 @@ discard block |
||
221 | 221 | break; |
222 | 222 | case 'q': |
223 | 223 | // Quarterly recurring subscription |
224 | - $identifier = ceil(((int)$date->format('n')) / 3) . 'Q' . $date->format('y'); |
|
224 | + $identifier = ceil(((int) $date->format('n')) / 3) . 'Q' . $date->format('y'); |
|
225 | 225 | break; |
226 | 226 | case 'hy': |
227 | 227 | // Half-yearly recurring subscription |
228 | - $identifier = ceil(((int)$date->format('n')) / 6) . '/' . $date->format('Y'); |
|
228 | + $identifier = ceil(((int) $date->format('n')) / 6) . '/' . $date->format('Y'); |
|
229 | 229 | break; |
230 | 230 | case 'y': |
231 | 231 | // Yearly recurring subscription |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | public function invoice() : bool |
255 | 255 | { |
256 | - if ( $this->state >= self::STATE_INVOICED |
|
256 | + if ($this->state >= self::STATE_INVOICED |
|
257 | 257 | || $this->orgOpenpsaObtype == org_openpsa_products_product_dba::DELIVERY_SUBSCRIPTION) { |
258 | 258 | return false; |
259 | 259 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | midcom::get()->uimessages->add(midcom::get()->i18n->get_string('org.openpsa.sales', 'org.openpsa.sales'), sprintf(midcom::get()->i18n->get_string('marked deliverable "%s" delivered', 'org.openpsa.sales'), $this->title)); |
357 | 357 | |
358 | 358 | // Check if we need to create task or ship goods |
359 | - if ( $update_deliveries |
|
359 | + if ($update_deliveries |
|
360 | 360 | && $product->orgOpenpsaObtype === org_openpsa_products_product_dba::TYPE_SERVICE) { |
361 | 361 | // Change status of tasks connected to the deliverable |
362 | 362 | $qb = org_openpsa_projects_task_dba::new_query_builder(); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $this->language = $language; |
24 | 24 | } |
25 | 25 | |
26 | - public function number(int|float $value, int $precision = 2) |
|
26 | + public function number(int | float $value, int $precision = 2) |
|
27 | 27 | { |
28 | 28 | // The fallback implementation in Intl only supports DECIMAL, so we hardcode the style here.. |
29 | 29 | $formatter = new NumberFormatter($this->get_locale(), NumberFormatter::DECIMAL); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return $formatter->format($value); |
32 | 32 | } |
33 | 33 | |
34 | - public function amount(int|float $value) |
|
34 | + public function amount(int | float $value) |
|
35 | 35 | { |
36 | 36 | // The fallback implementation in Intl only supports DECIMAL, so we hardcode the style here.. |
37 | 37 | $formatter = new NumberFormatter($this->get_locale(), NumberFormatter::DECIMAL); |
@@ -40,24 +40,24 @@ discard block |
||
40 | 40 | return $formatter->format($value); |
41 | 41 | } |
42 | 42 | |
43 | - public function date(int|string|null|DateTimeInterface $value = null, int|string $dateformat = 'medium') |
|
43 | + public function date(int | string | null | DateTimeInterface $value = null, int | string $dateformat = 'medium') |
|
44 | 44 | { |
45 | 45 | return $this->datetime($value, $dateformat, IntlDateFormatter::NONE); |
46 | 46 | } |
47 | 47 | |
48 | - public function time(int|string|null|DateTimeInterface $value = null, int|string $timeformat = 'short') |
|
48 | + public function time(int | string | null | DateTimeInterface $value = null, int | string $timeformat = 'short') |
|
49 | 49 | { |
50 | 50 | return $this->datetime($value, IntlDateFormatter::NONE, $timeformat); |
51 | 51 | } |
52 | 52 | |
53 | - public function datetime(int|string|null|DateTimeInterface $value = null, int|string $dateformat = 'medium', int|string $timeformat = 'short') |
|
53 | + public function datetime(int | string | null | DateTimeInterface $value = null, int | string $dateformat = 'medium', int | string $timeformat = 'short') |
|
54 | 54 | { |
55 | 55 | $value ??= time(); |
56 | 56 | $formatter = new IntlDateFormatter($this->get_locale(), $this->constant($dateformat), $this->constant($timeformat)); |
57 | 57 | return $formatter->format($value); |
58 | 58 | } |
59 | 59 | |
60 | - public function customdate(int|string|DateTimeInterface $value, string $pattern) |
|
60 | + public function customdate(int | string | DateTimeInterface $value, string $pattern) |
|
61 | 61 | { |
62 | 62 | $formatter = new IntlDateFormatter($this->get_locale(), IntlDateFormatter::FULL, IntlDateFormatter::FULL); |
63 | 63 | $formatter->setPattern($pattern); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | return $ranger->format($start, $end); |
80 | 80 | } |
81 | 81 | |
82 | - private function constant(int|string $input) : int |
|
82 | + private function constant(int | string $input) : int |
|
83 | 83 | { |
84 | 84 | if (is_int($input)) { |
85 | 85 | return $input; |
@@ -92,7 +92,7 @@ |
||
92 | 92 | |
93 | 93 | // sending per email enabled in billing data? |
94 | 94 | $billing_data = org_openpsa_invoices_billing_data_dba::get_by_object($this->invoice); |
95 | - if ( !$this->invoice->sent && intval($billing_data->sendingoption) == 2) { |
|
95 | + if (!$this->invoice->sent && intval($billing_data->sendingoption) == 2) { |
|
96 | 96 | $buttons[] = $workflow->get_button( |
97 | 97 | $this->router->generate('invoice_send_by_mail', ['guid' => $this->invoice->guid]), |
98 | 98 | [ |
@@ -132,7 +132,8 @@ discard block |
||
132 | 132 | try { |
133 | 133 | $pdf_helper->render_and_attach(); |
134 | 134 | return $this->reply(true, $this->_l10n->get('pdf created')); |
135 | - } catch (midcom_error $e) { |
|
135 | + } |
|
136 | + catch (midcom_error $e) { |
|
136 | 137 | return $this->reply(false, $this->_l10n->get('pdf creation failed') . ': ' . $e->getMessage()); |
137 | 138 | } |
138 | 139 | } |
@@ -143,7 +144,8 @@ discard block |
||
143 | 144 | try { |
144 | 145 | $pdf_helper->render_and_attach('reminder'); |
145 | 146 | return $this->reply(true, $this->_l10n->get('payment warning pdf created')); |
146 | - } catch (midcom_error $e) { |
|
147 | + } |
|
148 | + catch (midcom_error $e) { |
|
147 | 149 | return $this->reply(false, $this->_l10n->get('payment warning pdf creation failed') . ': ' . $e->getMessage()); |
148 | 150 | } |
149 | 151 | } |