Completed
Pull Request — master (#20)
by Alexander
69:33 queued 44:05
created
src/Validators/LoaderValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
         /** @uses ActiveRecord::find() */
80 80
         $query = $this->getQuery()->andWhere([$this->operator, $this->targetAttribute, $value]);
81 81
 
82
-        $closure = function ($value, $attribute) {
82
+        $closure = function($value, $attribute) {
83 83
             $this->{$attribute} = $value;
84 84
             return $value;
85 85
         };
Please login to merge, or discard this patch.
src/Validators/FileValidator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
     }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
         return array_reduce(
109 109
             $files,
110
-            function (bool $carry, UploadedFile $file) use ($model, $attribute) {
110
+            function(bool $carry, UploadedFile $file) use ($model, $attribute) {
111 111
                 if (!$carry) {
112 112
                     return false;
113 113
                 }
Please login to merge, or discard this patch.
src/Helpers/QueryHelper.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -30,6 +30,7 @@
 block discarded – undo
30 30
      * Only for PostgreSQL
31 31
      *
32 32
      * @param array ...$params
33
+     * @param string $params
33 34
      * @return Expression
34 35
      */
35 36
     public static function coalesce(...$params): Expression
Please login to merge, or discard this patch.
src/Behaviors/BooleanBehavior.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
             return $value;
77 77
         }
78 78
 
79
-        if (!in_array($this->returnType, [static::RETURN_TYPE_BOOL, static::RETURN_TYPE_INT,])) {
79
+        if (!in_array($this->returnType, [static::RETURN_TYPE_BOOL, static::RETURN_TYPE_INT, ])) {
80 80
             throw new InvalidConfigException("Invalid return type {$this->returnType}");
81 81
         }
82 82
         return $this->returnType === static::RETURN_TYPE_BOOL ? $value : (int)$value;
Please login to merge, or discard this patch.
src/Database/Transaction.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace Horat1us\Yii\Database;
4 4
 
5 5
 use Horat1us\Yii\Interfaces\TransactionInterface;
6
-
7 6
 use yii\db\Connection;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.
src/Behaviors/LoaderBehavior.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
             return;
164 164
         }
165 165
 
166
-        $closure = function (object $value, string $attribute) {
166
+        $closure = function(object $value, string $attribute) {
167 167
             $this->{$attribute} = $value;
168 168
         };
169 169
         $closure->call($this->owner, $object, $this->attribute);
Please login to merge, or discard this patch.
tests/Helpers/ArrayHelperTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,23 +17,23 @@
 block discarded – undo
17 17
 {
18 18
     public function testPermuting()
19 19
     {
20
-        $input = ['a', 'b',];
20
+        $input = ['a', 'b', ];
21 21
         $output = ArrayHelper::permute($input);
22 22
         $this->assertCount(2, $output);
23
-        $this->assertEquals(['a', 'b',], $output[0]);
24
-        $this->assertEquals(['b', 'a',], $output[1]);
23
+        $this->assertEquals(['a', 'b', ], $output[0]);
24
+        $this->assertEquals(['b', 'a', ], $output[1]);
25 25
     }
26 26
 
27 27
     public function testSome()
28 28
     {
29 29
         $array = [1, 2, 3];
30 30
 
31
-        $arrayHas2 = ArrayHelper::some($array, function (int $item) {
31
+        $arrayHas2 = ArrayHelper::some($array, function(int $item) {
32 32
             return $item === 2;
33 33
         });
34 34
         $this->assertTrue($arrayHas2);
35 35
 
36
-        $arrayDoesNotHave4 = ArrayHelper::some($array, function (int $item) {
36
+        $arrayDoesNotHave4 = ArrayHelper::some($array, function(int $item) {
37 37
             return $item === 4;
38 38
         });
39 39
         $this->assertFalse($arrayDoesNotHave4);
Please login to merge, or discard this patch.
tests/Behaviors/FileLoaderBehaviorTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
     public function testLoadingMultipleFiles()
47 47
     {
48
-        $model = new FileLoaderBehaviorMock(['multiple' => true,]);
48
+        $model = new FileLoaderBehaviorMock(['multiple' => true, ]);
49 49
         $model->validate();
50 50
         $this->assertNotEmpty($model->file);
51 51
         $this->assertTrue(is_array($model->file));
Please login to merge, or discard this patch.
src/Behaviors/FlexibleTimestampBehavior.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,16 +40,16 @@
 block discarded – undo
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
                 ],
Please login to merge, or discard this patch.