Passed
Pull Request — master (#363)
by Def
11:52
created
src/TestSupport/TestCommandTrait.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $row = $rows[2];
219 219
         $this->assertEquals(3, $row['id']);
220 220
         $this->assertEquals('user3', $row['name']);
221
-        $this->assertTrue(is_array($rows) && count($rows)>1 && count($rows[0]) === 2);
221
+        $this->assertTrue(is_array($rows) && count($rows) > 1 && count($rows[0]) === 2);
222 222
 
223 223
         $rows = $db->createCommand('SELECT * FROM {{customer}} WHERE [[id]] = 10')->queryAll();
224 224
         $this->assertEquals([], $rows);
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         $command = $db->createCommand();
291 291
         for ($i = 0; $i < $attemptsInsertRows; $i++) {
292
-            $values[$i] = ['t' . $i .'@any.com', 't'.$i, 't' . $i . ' address'];
292
+            $values[$i] = ['t' . $i . '@any.com', 't' . $i, 't' . $i . ' address'];
293 293
         }
294 294
 
295 295
         $command->batchInsert('{{customer}}', ['email', 'name', 'address'], $values);
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
      */
340 340
     public function testBatchInsertWithYield(): void
341 341
     {
342
-        $rows = (static function () {
342
+        $rows = (static function() {
343 343
             foreach ([['[email protected]', 'test name', 'test address']] as $row) {
344 344
                 yield $row;
345 345
             }
@@ -963,14 +963,14 @@  discard block
 block discarded – undo
963 963
         $update->bindValues([':id' => 1, ':name' => 'user11'])->execute();
964 964
         $this->assertEquals('user11', $command->bindValue(':id', 1)->queryScalar());
965 965
 
966
-        $db->cache(function (ConnectionInterface $db) use ($command, $update) {
966
+        $db->cache(function(ConnectionInterface $db) use ($command, $update) {
967 967
             $this->assertEquals('user2', $command->bindValue(':id', 2)->queryScalar());
968 968
 
969 969
             $update->bindValues([':id' => 2, ':name' => 'user22'])->execute();
970 970
 
971 971
             $this->assertEquals('user2', $command->bindValue(':id', 2)->queryScalar());
972 972
 
973
-            $db->noCache(function () use ($command) {
973
+            $db->noCache(function() use ($command) {
974 974
                 $this->assertEquals('user22', $command->bindValue(':id', 2)->queryScalar());
975 975
             });
976 976
 
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
         /** @psalm-suppress PossiblyNullReference */
981 981
         $this->queryCache->setEnable(false);
982 982
 
983
-        $db->cache(function () use ($command, $update) {
983
+        $db->cache(function() use ($command, $update) {
984 984
             $this->assertEquals('user22', $command->bindValue(':id', 2)->queryScalar());
985 985
             $update->bindValues([':id' => 2, ':name' => 'user2'])->execute();
986 986
             $this->assertEquals('user2', $command->bindValue(':id', 2)->queryScalar());
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
 
998 998
         $command = $db->createCommand('SELECT [[name]] FROM {{customer}} WHERE [[id]] = :id');
999 999
 
1000
-        $db->cache(function () use ($command) {
1000
+        $db->cache(function() use ($command) {
1001 1001
             $this->assertEquals('user11', $command->bindValue(':id', 1)->queryScalar());
1002 1002
             $this->assertEquals('user1', $command->noCache()->bindValue(':id', 1)->queryScalar());
1003 1003
         }, 10);
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
         $this->invokeMethod(
1072 1072
             $command,
1073 1073
             'setRetryHandler',
1074
-            [static function ($exception, $attempt) use (&$attempts, &$hitHandler) {
1074
+            [static function($exception, $attempt) use (&$attempts, &$hitHandler) {
1075 1075
                 $attempts = $attempt;
1076 1076
                 $hitHandler = true;
1077 1077
 
@@ -1142,8 +1142,8 @@  discard block
 block discarded – undo
1142 1142
                 'type',
1143 1143
                 ['int_col', 'float_col', 'char_col', 'bool_col'],
1144 1144
                 'values' => [
1145
-                    ['0', '0.0', 'test string', true,],
1146
-                    [false, 0, 'test string2', false,],
1145
+                    ['0', '0.0', 'test string', true, ],
1146
+                    [false, 0, 'test string2', false, ],
1147 1147
                 ],
1148 1148
                 'expected' => DbHelper::replaceQuotes(
1149 1149
                     'INSERT INTO [[type]] ([[int_col]], [[float_col]], [[char_col]], [[bool_col]])'
Please login to merge, or discard this patch.
src/QueryBuilder/DMLQueryBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $values = [];
60 60
 
61 61
         /** @psalm-var array<array-key, array<array-key, string>> $rows */
62
-        foreach($rows as $row) {
62
+        foreach ($rows as $row) {
63 63
             $placeholders = [];
64 64
             foreach ($row as $index => $value) {
65 65
                 if (isset($columns[$index], $columnSchemas[$columns[$index]])) {
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         /** Remove duplicates */
340 340
         $constraints = array_combine(
341 341
             array_map(
342
-                static function (Constraint $constraint) {
342
+                static function(Constraint $constraint) {
343 343
                     $columns = $constraint->getColumnNames() ?? [];
344 344
                     $columns = is_array($columns) ? $columns : [$columns];
345 345
                     sort($columns, SORT_STRING);
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
         $constraints = array_values(
358 358
             array_filter(
359 359
                 $constraints,
360
-                static function (Constraint $constraint) use ($quoter, $columns, &$columnNames) {
360
+                static function(Constraint $constraint) use ($quoter, $columns, &$columnNames) {
361 361
                     /** @psalm-var string[]|string */
362 362
                     $getColumnNames = $constraint->getColumnNames() ?? [];
363 363
                     $constraintColumnNames = [];
Please login to merge, or discard this patch.
src/Schema/Quoter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     public function getTableNameParts(string $name): array
35 35
     {
36 36
         $parts = array_slice(explode('.', $name), -2, 2);
37
-        return array_map(function ($part) {
37
+        return array_map(function($part) {
38 38
             return $this->unquoteSimpleTableName($part);
39 39
         }, $parts);
40 40
     }
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     {
55 55
         if (strrpos($name, '.') !== false) {
56 56
             $parts = explode('.', $name);
57
-            $name = $parts[count($parts)-1];
57
+            $name = $parts[count($parts) - 1];
58 58
         }
59 59
         return preg_replace('|^\[\[([_\w\-. ]+)\]\]$|', '\1', $name);
60 60
     }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     {
107 107
         return preg_replace_callback(
108 108
             '/({{(%?[\w\-. ]+%?)}}|\\[\\[([\w\-. ]+)]])/',
109
-            function ($matches) {
109
+            function($matches) {
110 110
                 if (isset($matches[3])) {
111 111
                     return $this->quoteColumnName($matches[3]);
112 112
                 }
Please login to merge, or discard this patch.