@@ -19,12 +19,12 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | private static $levels = array( |
| 21 | 21 | LogLevel::EMERGENCY, // 0 |
| 22 | - LogLevel::ALERT, // 1 |
|
| 23 | - LogLevel::CRITICAL, // 2 |
|
| 24 | - LogLevel::ERROR, // 3 |
|
| 25 | - LogLevel::WARNING, // 4 |
|
| 26 | - LogLevel::NOTICE, // 5 |
|
| 27 | - LogLevel::INFO, // 6 |
|
| 22 | + LogLevel::ALERT, // 1 |
|
| 23 | + LogLevel::CRITICAL, // 2 |
|
| 24 | + LogLevel::ERROR, // 3 |
|
| 25 | + LogLevel::WARNING, // 4 |
|
| 26 | + LogLevel::NOTICE, // 5 |
|
| 27 | + LogLevel::INFO, // 6 |
|
| 28 | 28 | LogLevel::DEBUG // 7 |
| 29 | 29 | ); |
| 30 | 30 | |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | if ($index->isUnique()) { |
| 77 | 77 | return 'findOneBy'.implode('And', $methodNameComponent); |
| 78 | 78 | } else { |
| 79 | - return 'findBy' . implode('And', $methodNameComponent); |
|
| 79 | + return 'findBy'.implode('And', $methodNameComponent); |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | { |
| 7 | 7 | public static function getValidVariableName(string $variableName): string |
| 8 | 8 | { |
| 9 | - return preg_replace_callback('/^(\d+)/', static function (array $match) { |
|
| 9 | + return preg_replace_callback('/^(\d+)/', static function(array $match) { |
|
| 10 | 10 | $f = new \NumberFormatter('en', \NumberFormatter::SPELLOUT); |
| 11 | 11 | $number = $f->format((int) $match[0]); |
| 12 | 12 | return preg_replace('/[^a-z]+/i', '_', $number); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $alias = AbstractQueryFactory::getColumnAlias($tableName, $columnName); |
| 215 | 215 | $astColumn = [ |
| 216 | 216 | 'expr_type' => 'colref', |
| 217 | - 'base_expr' => $connection->quoteIdentifier($tableName) . '.' . $connection->quoteIdentifier($columnName), |
|
| 217 | + 'base_expr' => $connection->quoteIdentifier($tableName).'.'.$connection->quoteIdentifier($columnName), |
|
| 218 | 218 | 'no_quotes' => [ |
| 219 | 219 | 'delim' => '.', |
| 220 | 220 | 'parts' => [ |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | return $this->generateWrappedSqlCount($parsedSql); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | - $countSubExpr = array_map(function (array $item) { |
|
| 305 | + $countSubExpr = array_map(function(array $item) { |
|
| 306 | 306 | unset($item['alias']); |
| 307 | 307 | return $item; |
| 308 | 308 | }, $parsedSql['SELECT']); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | // Let's compute the COUNT. |
| 51 | 51 | $pkColumnNames = $this->tdbmService->getPrimaryKeyColumns($this->mainTable); |
| 52 | - $pkColumnNames = array_map(function ($pkColumn) use ($mySqlPlatform) { |
|
| 52 | + $pkColumnNames = array_map(function($pkColumn) use ($mySqlPlatform) { |
|
| 53 | 53 | return $mySqlPlatform->quoteIdentifier($this->mainTable).'.'.$mySqlPlatform->quoteIdentifier($pkColumn); |
| 54 | 54 | }, $pkColumnNames); |
| 55 | 55 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | private function getParentRelationshipForeignKeys(string $tableName): array |
| 115 | 115 | { |
| 116 | - return $this->fromCache($this->cachePrefix.'_parentrelationshipfks_'.$tableName, function () use ($tableName) { |
|
| 116 | + return $this->fromCache($this->cachePrefix.'_parentrelationshipfks_'.$tableName, function() use ($tableName) { |
|
| 117 | 117 | return $this->getParentRelationshipForeignKeysWithoutCache($tableName); |
| 118 | 118 | }); |
| 119 | 119 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | private function getChildrenRelationshipForeignKeys(string $tableName) : array |
| 144 | 144 | { |
| 145 | - return $this->fromCache($this->cachePrefix.'_childrenrelationshipfks_'.$tableName, function () use ($tableName) { |
|
| 145 | + return $this->fromCache($this->cachePrefix.'_childrenrelationshipfks_'.$tableName, function() use ($tableName) { |
|
| 146 | 146 | return $this->getChildrenRelationshipForeignKeysWithoutCache($tableName); |
| 147 | 147 | }); |
| 148 | 148 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $children = $this->schemaAnalyzer->getChildrenRelationships($tableName); |
| 158 | 158 | |
| 159 | 159 | if (!empty($children)) { |
| 160 | - $fksTables = array_map(function (ForeignKeyConstraint $fk) { |
|
| 160 | + $fksTables = array_map(function(ForeignKeyConstraint $fk) { |
|
| 161 | 161 | return $this->getChildrenRelationshipForeignKeys($fk->getLocalTableName()); |
| 162 | 162 | }, $children); |
| 163 | 163 | |
@@ -207,7 +207,7 @@ |
||
| 207 | 207 | if (strlen($alias) <= 30) { // Older oracle version had a limit of 30 characters for identifiers |
| 208 | 208 | return $alias; |
| 209 | 209 | } |
| 210 | - return substr($columnName, 0, 20) . crc32($tableName.'____'.$columnName); |
|
| 210 | + return substr($columnName, 0, 20).crc32($tableName.'____'.$columnName); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | abstract protected function compute(): void; |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | public function getIncomingForeignKeys(string $tableName): array |
| 143 | 143 | { |
| 144 | 144 | $junctionTables = $this->schemaAnalyzer->detectJunctionTables(true); |
| 145 | - $junctionTableNames = array_map(function (Table $table) { |
|
| 145 | + $junctionTableNames = array_map(function(Table $table) { |
|
| 146 | 146 | return $table->getName(); |
| 147 | 147 | }, $junctionTables); |
| 148 | 148 | $childrenRelationships = $this->schemaAnalyzer->getChildrenRelationships($tableName); |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | { |
| 448 | 448 | $beans = $this->tdbmService->findObjects('person', null, [], 'person.id ASC', [], null, TDBMObject::class); |
| 449 | 449 | |
| 450 | - $results = $beans->map(function ($item) { |
|
| 450 | + $results = $beans->map(function($item) { |
|
| 451 | 451 | return $item->getProperty('id', 'person'); |
| 452 | 452 | })->toArray(); |
| 453 | 453 | |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | // Same test with page |
| 457 | 457 | $page = $beans->take(0, 2); |
| 458 | 458 | |
| 459 | - $results = $page->map(function ($item) { |
|
| 459 | + $results = $page->map(function($item) { |
|
| 460 | 460 | return $item->getProperty('id', 'person'); |
| 461 | 461 | })->toArray(); |
| 462 | 462 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public function testConstructorException1(): void |
| 29 | 29 | { |
| 30 | 30 | $this->expectException('TheCodingMachine\TDBM\TDBMException'); |
| 31 | - $mapIterator = new MapIterator(new \DateTime(), function ($item) { |
|
| 31 | + $mapIterator = new MapIterator(new \DateTime(), function($item) { |
|
| 32 | 32 | return $item; |
| 33 | 33 | }); |
| 34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function testConstructorException2(): void |
| 37 | 37 | { |
| 38 | 38 | $this->expectException('TheCodingMachine\TDBM\TDBMException'); |
| 39 | - $mapIterator = new MapIterator(array(1, 2, 3), function () { |
|
| 39 | + $mapIterator = new MapIterator(array(1, 2, 3), function() { |
|
| 40 | 40 | return $item; |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | public function testJsonSerialize(): void |
| 45 | 45 | { |
| 46 | 46 | $value = array(1, 2, 3); |
| 47 | - $mapIterator = new MapIterator($value, function ($item) { |
|
| 47 | + $mapIterator = new MapIterator($value, function($item) { |
|
| 48 | 48 | return $item; |
| 49 | 49 | }); |
| 50 | 50 | |