@@ -42,10 +42,10 @@ |
||
| 42 | 42 | * @param array ...$args |
| 43 | 43 | * @return array |
| 44 | 44 | */ |
| 45 | - public static function forEach(callable $closure, array $array, ...$args) |
|
| 45 | + public static function forEach (callable $closure, array $array, ...$args) |
|
| 46 | 46 | { |
| 47 | 47 | return \array_map( |
| 48 | - function ($item) use ($closure, $args) { |
|
| 48 | + function($item) use ($closure, $args) { |
|
| 49 | 49 | return static::within($closure, $item, ...$args); |
| 50 | 50 | }, |
| 51 | 51 | $array |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public static function sqlCall(string $sqlMethod, ...$params): Expression |
| 19 | 19 | { |
| 20 | - $expressions = implode(', ', \array_map(function ($expression) { |
|
| 20 | + $expressions = implode(', ', \array_map(function($expression) { |
|
| 21 | 21 | return "({$expression})"; |
| 22 | 22 | }, (array)$params)); |
| 23 | 23 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function filterFiles(Model $model, string $attribute) |
| 48 | 48 | { |
| 49 | - return $model->{$attribute} = \array_values(\array_filter((array)$model->{$attribute}, function ($file) { |
|
| 49 | + return $model->{$attribute} = \array_values(\array_filter((array)$model->{$attribute}, function($file) { |
|
| 50 | 50 | return $file instanceof UploadedFile && $file->error != UPLOAD_ERR_NO_FILE; |
| 51 | 51 | })); |
| 52 | 52 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | return \array_reduce( |
| 110 | 110 | $files, |
| 111 | - function (bool $carry, UploadedFile $file) use ($model, $attribute) { |
|
| 111 | + function(bool $carry, UploadedFile $file) use ($model, $attribute) { |
|
| 112 | 112 | if (!$carry) { |
| 113 | 113 | return false; |
| 114 | 114 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function getClosure(): \Closure |
| 59 | 59 | { |
| 60 | - return function ($model, $attribute) { |
|
| 60 | + return function($model, $attribute) { |
|
| 61 | 61 | $prefix = $this->prefix ?? \strtoupper($attribute) . '_'; |
| 62 | 62 | $class = $this->targetClass ?? \get_class($model); |
| 63 | 63 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | return $constants; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | - return \array_filter($constants, function (string $constant): bool { |
|
| 109 | + return \array_filter($constants, function(string $constant): bool { |
|
| 110 | 110 | return !\in_array($constant, $this->except); |
| 111 | 111 | }); |
| 112 | 112 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | return $value; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (!\in_array($this->returnType, [static::RETURN_TYPE_BOOL, static::RETURN_TYPE_INT,])) { |
|
| 80 | + if (!\in_array($this->returnType, [static::RETURN_TYPE_BOOL, static::RETURN_TYPE_INT, ])) { |
|
| 81 | 81 | throw new InvalidConfigException("Invalid return type {$this->returnType}"); |
| 82 | 82 | } |
| 83 | 83 | return $this->returnType === static::RETURN_TYPE_BOOL ? $value : (int)$value; |
@@ -40,16 +40,16 @@ |
||
| 40 | 40 | $date = null; |
| 41 | 41 | \preg_replace_callback_array( |
| 42 | 42 | [ |
| 43 | - '/^\d{4}\-\d{2}\-\d{2}$/' => function ($match) use (&$date) { |
|
| 43 | + '/^\d{4}\-\d{2}\-\d{2}$/' => function($match) use (&$date) { |
|
| 44 | 44 | $date = Carbon::createFromFormat('Y-m-d', $match[0]); |
| 45 | 45 | }, |
| 46 | - '/^\d{2}\.\d{2}\.\d{4}$/' => function ($match) use (&$date) { |
|
| 46 | + '/^\d{2}\.\d{2}\.\d{4}$/' => function($match) use (&$date) { |
|
| 47 | 47 | $date = Carbon::createFromFormat('d.m.Y', $match[0]); |
| 48 | 48 | }, |
| 49 | - '/^\d{2}\.\d{2}\.\d{2}$/' => function ($match) use (&$date) { |
|
| 49 | + '/^\d{2}\.\d{2}\.\d{2}$/' => function($match) use (&$date) { |
|
| 50 | 50 | $date = Carbon::createFromFormat('d.m.y', $match[0]); |
| 51 | 51 | }, |
| 52 | - '/^\d+$/' => function ($match) use (&$date) { |
|
| 52 | + '/^\d+$/' => function($match) use (&$date) { |
|
| 53 | 53 | $date = Carbon::createFromTimestamp($match[0]); |
| 54 | 54 | } |
| 55 | 55 | ], |