@@ -314,7 +314,7 @@ |
||
314 | 314 | $this->addContext('maintenance_state', app()->isInMaintenance()); |
315 | 315 | |
316 | 316 | // Set nonce for Content Security Policy |
317 | - $nonces = $this->request->getAttribute(SecurityPolicy::class); |
|
317 | + $nonces = $this->request->getAttribute(SecurityPolicy::class); |
|
318 | 318 | |
319 | 319 | if ($nonces !== null) { |
320 | 320 | $this->addContext('style_nonce', $nonces['nonces']['style']); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public function register(): void |
52 | 52 | { |
53 | - $this->app->bind(TransportInterface::class, function (ContainerInterface $app) { |
|
53 | + $this->app->bind(TransportInterface::class, function(ContainerInterface $app) { |
|
54 | 54 | $smtp = new SMTP( |
55 | 55 | $app->get(Config::class)->get('mail.smtp.host', 'localhost'), |
56 | 56 | $app->get(Config::class)->get('mail.smtp.port', 25), |
@@ -108,7 +108,7 @@ |
||
108 | 108 | /** |
109 | 109 | * {@inheritdoc} |
110 | 110 | */ |
111 | - public function getId(): int|string |
|
111 | + public function getId(): int | string |
|
112 | 112 | { |
113 | 113 | if ($this->isLogged() === false) { |
114 | 114 | throw new AccountNotFoundException('User not logged', 401); |
@@ -121,7 +121,7 @@ |
||
121 | 121 | /** |
122 | 122 | * {@inheritdoc} |
123 | 123 | */ |
124 | - public function getId(): int|string |
|
124 | + public function getId(): int | string |
|
125 | 125 | { |
126 | 126 | if ($this->isLogged() === false) { |
127 | 127 | throw new AccountNotFoundException('User not logged', 401); |
@@ -104,5 +104,5 @@ |
||
104 | 104 | * |
105 | 105 | * @throws AccountNotFoundException if can not find the account information |
106 | 106 | */ |
107 | - public function getId(): int|string; |
|
107 | + public function getId(): int | string; |
|
108 | 108 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | * Return the validation max file size rules of attachment upload |
446 | 446 | * @return int|string |
447 | 447 | */ |
448 | - protected function getAttachmentMaxSize(): int|string |
|
448 | + protected function getAttachmentMaxSize(): int | string |
|
449 | 449 | { |
450 | 450 | return '2M'; |
451 | 451 | } |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | * Return the image max file size value |
455 | 455 | * @return int|string |
456 | 456 | */ |
457 | - protected function getImageMaxSize(): int|string |
|
457 | + protected function getImageMaxSize(): int | string |
|
458 | 458 | { |
459 | 459 | return '1M'; |
460 | 460 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @param float|int $amount |
96 | 96 | * @return string |
97 | 97 | */ |
98 | - public static function numberToString(float|int $amount): string |
|
98 | + public static function numberToString(float | int $amount): string |
|
99 | 99 | { |
100 | 100 | $value = (string) $amount; |
101 | 101 | if (stripos($value, 'e') !== false) { |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | return $value; |
120 | 120 | } |
121 | 121 | list($base, $decimal) = explode('E', str_replace('e', 'E', $value)); |
122 | - $exponent = (int)$decimal; |
|
122 | + $exponent = (int) $decimal; |
|
123 | 123 | if ($exponent >= 0) { |
124 | 124 | // Positive exponent: add zeros to the right |
125 | 125 | $parts = explode('.', $base); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public static function createTree( |
51 | 51 | array $elements, |
52 | - string|int|null $parentId = 0, |
|
52 | + string | int | null $parentId = 0, |
|
53 | 53 | string $idField = 'id', |
54 | 54 | string $parentField = 'parent_id' |
55 | 55 | ): array { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | ]; |
119 | 119 | |
120 | 120 | if ($type & self::CREATE) { |
121 | - $mapper->on('save', function ( |
|
121 | + $mapper->on('save', function( |
|
122 | 122 | Entity $entity, |
123 | 123 | DataMapper $dm |
124 | 124 | ) use ( |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | if ($type & self::UPDATE) { |
148 | - $mapper->on('update', function ( |
|
148 | + $mapper->on('update', function( |
|
149 | 149 | Entity $entity, |
150 | 150 | DataMapper $dm |
151 | 151 | ) use ( |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | |
174 | 174 | if ($type & self::DELETE) { |
175 | - $mapper->on('delete', function ( |
|
175 | + $mapper->on('delete', function( |
|
176 | 176 | Entity $entity, |
177 | 177 | DataMapper $dm |
178 | 178 | ) use ( |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | $results = []; |
224 | 224 | |
225 | 225 | // Closure to set entity relation data |
226 | - $setRelation = function (Entity $e, array|string $relation): string { |
|
226 | + $setRelation = function(Entity $e, array | string $relation): string { |
|
227 | 227 | $relation = Arr::wrap($relation); |
228 | 228 | $text = []; |
229 | 229 | foreach ($relation as $val) { |
230 | - $text[] = $e->{$val}; |
|
230 | + $text[] = $e->{$val}; |
|
231 | 231 | } |
232 | 232 | return Arr::toString($text, ' '); |
233 | 233 | }; |