@@ -34,7 +34,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 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); |
@@ -339,7 +339,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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]])' |