@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | //Retrieve bbcode from entity |
139 | 139 | $bbcode = $this->propertyAccessor->getValue($result, $property); |
140 | 140 | //Check if the current property really contains BBCode |
141 | - if (! preg_match(static::BBCODE_REGEX, $bbcode)) { |
|
141 | + if (!preg_match(static::BBCODE_REGEX, $bbcode)) { |
|
142 | 142 | continue; |
143 | 143 | } |
144 | 144 | $io->writeln( |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | } |
160 | 160 | |
161 | 161 | //If we are not in dry run, save changes to DB |
162 | - if (! $input->getOption('dry-run')) { |
|
162 | + if (!$input->getOption('dry-run')) { |
|
163 | 163 | $this->em->flush(); |
164 | 164 | $io->success('Changes saved to DB successfully!'); |
165 | 165 | } |
@@ -137,7 +137,7 @@ |
||
137 | 137 | public function useFloatAmount(): bool |
138 | 138 | { |
139 | 139 | if ($this->partUnit instanceof MeasurementUnit) { |
140 | - return ! $this->partUnit->isInteger(); |
|
140 | + return !$this->partUnit->isInteger(); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | //When no part unit is set, treat it as part count, and so use the integer value. |
@@ -188,7 +188,7 @@ |
||
188 | 188 | } |
189 | 189 | |
190 | 190 | foreach ($all_orderdetails as $orderdetails) { |
191 | - if (! $orderdetails->getObsolete()) { |
|
191 | + if (!$orderdetails->getObsolete()) { |
|
192 | 192 | return false; |
193 | 193 | } |
194 | 194 | } |
@@ -269,7 +269,7 @@ |
||
269 | 269 | */ |
270 | 270 | public function getAmount(): float |
271 | 271 | { |
272 | - if ($this->part instanceof Part && ! $this->part->useFloatAmount()) { |
|
272 | + if ($this->part instanceof Part && !$this->part->useFloatAmount()) { |
|
273 | 273 | return round($this->amount); |
274 | 274 | } |
275 | 275 |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function getPriceRelatedQuantity(): float |
182 | 182 | { |
183 | - if ($this->orderdetail && $this->orderdetail->getPart() && ! $this->orderdetail->getPart()->useFloatAmount()) { |
|
183 | + if ($this->orderdetail && $this->orderdetail->getPart() && !$this->orderdetail->getPart()->useFloatAmount()) { |
|
184 | 184 | $tmp = round($this->price_related_quantity); |
185 | 185 | |
186 | 186 | return $tmp < 1 ? 1 : $tmp; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | public function getMinDiscountQuantity(): float |
205 | 205 | { |
206 | - if ($this->orderdetail && $this->orderdetail->getPart() && ! $this->orderdetail->getPart()->useFloatAmount()) { |
|
206 | + if ($this->orderdetail && $this->orderdetail->getPart() && !$this->orderdetail->getPart()->useFloatAmount()) { |
|
207 | 207 | $tmp = round($this->min_discount_quantity); |
208 | 208 | |
209 | 209 | return $tmp < 1 ? 1 : $tmp; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function attachmentToFile(Attachment $attachment): ?SplFileInfo |
56 | 56 | { |
57 | - if ($attachment->isExternal() || ! $this->isFileExisting($attachment)) { |
|
57 | + if ($attachment->isExternal() || !$this->isFileExisting($attachment)) { |
|
58 | 58 | return null; |
59 | 59 | } |
60 | 60 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | return null; |
129 | 129 | } |
130 | 130 | |
131 | - if (! $this->isFileExisting($attachment)) { |
|
131 | + if (!$this->isFileExisting($attachment)) { |
|
132 | 132 | return null; |
133 | 133 | } |
134 | 134 |
@@ -108,7 +108,7 @@ |
||
108 | 108 | */ |
109 | 109 | public function getThumbnailURL(Attachment $attachment, string $filter_name = 'thumbnail_sm'): string |
110 | 110 | { |
111 | - if (! $attachment->isPicture()) { |
|
111 | + if (!$attachment->isPicture()) { |
|
112 | 112 | throw new InvalidArgumentException('Thumbnail creation only works for picture attachments!'); |
113 | 113 | } |
114 | 114 |
@@ -184,7 +184,7 @@ |
||
184 | 184 | } |
185 | 185 | |
186 | 186 | //If the new string does not begin with a placeholder, it is invalid |
187 | - if (! preg_match('#^%\w+%#', $real_path)) { |
|
187 | + if (!preg_match('#^%\w+%#', $real_path)) { |
|
188 | 188 | return null; |
189 | 189 | } |
190 | 190 |
@@ -73,9 +73,9 @@ discard block |
||
73 | 73 | //Check for each element if it is valid: |
74 | 74 | foreach ($elements as $element) { |
75 | 75 | $element = trim($element); |
76 | - if (! preg_match('#^\.\w+$#', $element) // .ext is allowed |
|
77 | - && ! preg_match('#^[-\w.]+\/[-\w.]+#', $element) //Explicit MIME type is allowed |
|
78 | - && ! in_array($element, static::ALLOWED_MIME_PLACEHOLDERS, false)) { //image/* is allowed |
|
76 | + if (!preg_match('#^\.\w+$#', $element) // .ext is allowed |
|
77 | + && !preg_match('#^[-\w.]+\/[-\w.]+#', $element) //Explicit MIME type is allowed |
|
78 | + && !in_array($element, static::ALLOWED_MIME_PLACEHOLDERS, false)) { //image/* is allowed |
|
79 | 79 | return false; |
80 | 80 | } |
81 | 81 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $element = 'video/*'; |
122 | 122 | } elseif ('audio' === $element || 'audio/' === $element) { |
123 | 123 | $element = 'audio/*'; |
124 | - } elseif (! preg_match('#^[-\w.]+\/[-\w.*]+#', $element) && 0 !== strpos($element, '.')) { |
|
124 | + } elseif (!preg_match('#^[-\w.]+\/[-\w.*]+#', $element) && 0 !== strpos($element, '.')) { |
|
125 | 125 | //Convert jpg to .jpg |
126 | 126 | $element = '.'.$element; |
127 | 127 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | $filter = trim($filter); |
145 | 145 | |
146 | - return $this->cache->get('filter_exts_'.md5($filter), function (ItemInterface $item) use ($filter) { |
|
146 | + return $this->cache->get('filter_exts_'.md5($filter), function(ItemInterface $item) use ($filter) { |
|
147 | 147 | $elements = explode(',', $filter); |
148 | 148 | $extensions = []; |
149 | 149 |