Passed
Push — port/deeper-composite-fk ( f1f6b2 )
by
unknown
04:55
created
src/QueryFactory/FindObjectsFromSqlQueryFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/QueryFactory/AbstractQueryFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/ResultIterator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      */
85 85
     public static function createResultIterator(QueryFactory $queryFactory, array $parameters, ObjectStorageInterface $objectStorage, ?string $className, TDBMService $tdbmService, MagicQuery $magicQuery, int $mode, LoggerInterface $logger): self
86 86
     {
87
-        $iterator =  new static();
87
+        $iterator = new static();
88 88
         if ($mode !== TDBMService::MODE_CURSOR && $mode !== TDBMService::MODE_ARRAY) {
89 89
             throw new TDBMException("Unknown fetch mode: '".$mode."'");
90 90
         }
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
      */
282 282
     public function jsonSerialize($stopRecursion = false)
283 283
     {
284
-        return array_map(function (AbstractTDBMObject $item) use ($stopRecursion) {
284
+        return array_map(function(AbstractTDBMObject $item) use ($stopRecursion) {
285 285
             return $item->jsonSerialize($stopRecursion);
286 286
         }, $this->toArray());
287 287
     }
Please login to merge, or discard this patch.
src/TDBMSchemaAnalyzer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/TDBMService.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                 }
423 423
             }
424 424
 
425
-            return ['(' . implode(') AND (', $sqlParts) . ')', $parameters, $counter];
425
+            return ['('.implode(') AND (', $sqlParts).')', $parameters, $counter];
426 426
         } elseif ($filter_bag instanceof ResultIterator) {
427 427
             $subQuery = $filter_bag->_getSubQuery();
428 428
             return [$subQuery, [], $counter];
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
 
1001 1001
         return $this->fromCache(
1002 1002
             $this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables),
1003
-            function () use ($tables) {
1003
+            function() use ($tables) {
1004 1004
                 return $this->_getLinkBetweenInheritedTablesWithoutCache($tables);
1005 1005
             }
1006 1006
         );
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
      */
1049 1049
     public function _getRelatedTablesByInheritance(string $table): array
1050 1050
     {
1051
-        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) {
1051
+        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) {
1052 1052
             return $this->_getRelatedTablesByInheritanceWithoutCache($table);
1053 1053
         });
1054 1054
     }
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
     public function findObjects(string $mainTable, $filter = null, array $parameters = array(), $orderString = null, array $additionalTablesFetch = array(), ?int $mode = null, string $className = null, string $resultIteratorClass = ResultIterator::class): ResultIterator
1138 1138
     {
1139 1139
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1140
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1140
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1141 1141
         }
1142 1142
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1143 1143
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1174,7 +1174,7 @@  discard block
 block discarded – undo
1174 1174
     public function findObjectsFromSql(string $mainTable, string $from, $filter = null, array $parameters = array(), $orderString = null, ?int $mode = null, string $className = null, string $resultIteratorClass = ResultIterator::class): ResultIterator
1175 1175
     {
1176 1176
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1177
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1177
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1178 1178
         }
1179 1179
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1180 1180
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
         try {
1252 1252
             return $this->findObjectOrFail($table, $primaryKeys, [], $additionalTablesFetch, $className);
1253 1253
         } catch (NoBeanFoundException $exception) {
1254
-            $primaryKeysStringified = implode(' and ', array_map(function ($key, $value) {
1254
+            $primaryKeysStringified = implode(' and ', array_map(function($key, $value) {
1255 1255
                 return "'".$key."' = ".$value;
1256 1256
             }, array_keys($primaryKeys), $primaryKeys));
1257 1257
             throw new NoBeanFoundException("No result found for query on table '".$table."' for ".$primaryKeysStringified, 0, $exception);
@@ -1294,18 +1294,18 @@  discard block
 block discarded – undo
1294 1294
         if ($count > 1) {
1295 1295
             $additionalErrorInfos = '';
1296 1296
             if (is_string($filter) && !empty($parameters)) {
1297
-                $additionalErrorInfos = ' for filter "' . $filter.'"';
1297
+                $additionalErrorInfos = ' for filter "'.$filter.'"';
1298 1298
                 foreach ($parameters as $fieldName => $parameter) {
1299 1299
                     if (is_array($parameter)) {
1300
-                        $value = '(' . implode(',', $parameter) . ')';
1300
+                        $value = '('.implode(',', $parameter).')';
1301 1301
                     } else {
1302 1302
                         $value = $parameter;
1303 1303
                     }
1304
-                    $additionalErrorInfos = str_replace(':' . $fieldName, var_export($value, true), $additionalErrorInfos);
1304
+                    $additionalErrorInfos = str_replace(':'.$fieldName, var_export($value, true), $additionalErrorInfos);
1305 1305
                 }
1306 1306
             }
1307 1307
             $additionalErrorInfos .= '.';
1308
-            throw new DuplicateRowException("Error while querying an object in table '$mainTable': More than 1 row have been returned, but we should have received at most one" . $additionalErrorInfos);
1308
+            throw new DuplicateRowException("Error while querying an object in table '$mainTable': More than 1 row have been returned, but we should have received at most one".$additionalErrorInfos);
1309 1309
         } elseif ($count === 0) {
1310 1310
             return null;
1311 1311
         }
@@ -1348,7 +1348,7 @@  discard block
 block discarded – undo
1348 1348
     public function findObjectsFromRawSql(string $mainTable, string $sql, array $parameters = array(), ?int $mode = null, string $className = null, string $sqlCount = null, string $resultIteratorClass = ResultIterator::class): ResultIterator
1349 1349
     {
1350 1350
         if (!is_a($resultIteratorClass, ResultIterator::class, true)) {
1351
-            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'. ResultIterator::class. '`. `' . $resultIteratorClass . '` provided.');
1351
+            throw new TDBMInvalidArgumentException('$resultIteratorClass should be a `'.ResultIterator::class.'`. `'.$resultIteratorClass.'` provided.');
1352 1352
         }
1353 1353
         // $mainTable is not secured in MagicJoin, let's add a bit of security to avoid SQL injection.
1354 1354
         if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $mainTable)) {
@@ -1478,7 +1478,7 @@  discard block
 block discarded – undo
1478 1478
         $table1 = $fks[0]->getForeignTableName();
1479 1479
         $table2 = $fks[1]->getForeignTableName();
1480 1480
 
1481
-        $beanTables = array_map(function (DbRow $dbRow) {
1481
+        $beanTables = array_map(function(DbRow $dbRow) {
1482 1482
             return $dbRow->_getDbTableName();
1483 1483
         }, $bean->_getDbRows());
1484 1484
 
Please login to merge, or discard this patch.
src/Commands/GenerateCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 
50 50
         $fromLock = (bool) $input->getOption('from-lock');
51 51
 
52
-        $loggers = [ new ConsoleLogger($output) ];
52
+        $loggers = [new ConsoleLogger($output)];
53 53
 
54 54
         $logger = $alteredConf->getLogger();
55 55
         if ($logger) {
Please login to merge, or discard this patch.
src/PageIterator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public static function createResultIterator(ResultIterator $parentResult, string $magicSql, array $parameters, int $limit, int $offset, array $columnDescriptors, ObjectStorageInterface $objectStorage, ?string $className, TDBMService $tdbmService, MagicQuery $magicQuery, int $mode, LoggerInterface $logger): self
80 80
     {
81
-        $iterator =  new self();
81
+        $iterator = new self();
82 82
         $iterator->parentResult = $parentResult;
83 83
         $iterator->magicSql = $magicSql;
84 84
         $iterator->objectStorage = $objectStorage;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      */
278 278
     public function jsonSerialize()
279 279
     {
280
-        return array_map(function (AbstractTDBMObject $item) {
280
+        return array_map(function(AbstractTDBMObject $item) {
281 281
             return $item->jsonSerialize();
282 282
         }, $this->toArray());
283 283
     }
Please login to merge, or discard this patch.
src/InnerResultIterator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
      */
79 79
     public static function createInnerResultIterator(string $magicSql, array $parameters, ?int $limit, ?int $offset, array $columnDescriptors, ObjectStorageInterface $objectStorage, ?string $className, TDBMService $tdbmService, MagicQuery $magicQuery, LoggerInterface $logger): self
80 80
     {
81
-        $iterator =  new static();
81
+        $iterator = new static();
82 82
         $iterator->magicSql = $magicSql;
83 83
         $iterator->objectStorage = $objectStorage;
84 84
         $iterator->className = $className;
Please login to merge, or discard this patch.
src/Utils/StringUtils.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public static function getValidVariableName(string $variableName): string
10 10
     {
11
-        $valid = preg_replace_callback('/^(\d+)/', static function (array $match) {
11
+        $valid = preg_replace_callback('/^(\d+)/', static function(array $match) {
12 12
             $f = new \NumberFormatter('en', \NumberFormatter::SPELLOUT);
13 13
             $number = $f->format((int) $match[0]);
14 14
             return preg_replace('/[^a-z]+/i', '_', $number);
Please login to merge, or discard this patch.