Passed
Pull Request — master (#288)
by
unknown
08:29 queued 05:13
created
src/QueryFactory/FindObjectsFromRawSqlQueryFactory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         // Let's add the ORDER BY if any
143 143
         if (isset($parsedSql['0']['ORDER'])) {
144 144
             $orderByBuilder = new OrderByBuilder();
145
-            $processedSql .= " " . $orderByBuilder->build($parsedSql['0']['ORDER']);
145
+            $processedSql .= " ".$orderByBuilder->build($parsedSql['0']['ORDER']);
146 146
         }
147 147
 
148 148
         return [$processedSql, $sqlCount ?? $processedSqlCount, $columnDescriptors];
@@ -155,8 +155,8 @@  discard block
 block discarded – undo
155 155
     {
156 156
         $selectBuilder = new SelectStatementBuilder();
157 157
 
158
-        return implode(' UNION ', array_map(function ($clause) use ($selectBuilder) {
159
-            return '(' . $selectBuilder->build($clause) . ')';
158
+        return implode(' UNION ', array_map(function($clause) use ($selectBuilder) {
159
+            return '('.$selectBuilder->build($clause).')';
160 160
         }, $parsed['UNION']));
161 161
     }
162 162
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 $alias = AbstractQueryFactory::getColumnAlias($tableName, $columnName);
239 239
                 $astColumn = [
240 240
                     'expr_type' => 'colref',
241
-                    'base_expr' => $connection->quoteIdentifier($tableName) . '.' . $connection->quoteIdentifier($columnName),
241
+                    'base_expr' => $connection->quoteIdentifier($tableName).'.'.$connection->quoteIdentifier($columnName),
242 242
                     'no_quotes' => [
243 243
                         'delim' => '.',
244 244
                         'parts' => [
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                 return $this->generateWrappedSqlCount($parsedSql);
327 327
             }
328 328
 
329
-            $countSubExpr = array_map(function (array $item) {
329
+            $countSubExpr = array_map(function(array $item) {
330 330
                 unset($item['alias']);
331 331
                 return $item;
332 332
             }, $parsedSql['SELECT']);
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
                 $item['delim'] = ',';
404 404
                 $innerColumns[] = $item;
405 405
             }
406
-            $innerColumns[count($innerColumns)-1]['delim'] = false;
406
+            $innerColumns[count($innerColumns) - 1]['delim'] = false;
407 407
             $parsedSql['SELECT'] = $innerColumns;
408 408
 
409 409
             $parsedSql = [
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
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
         if ($this->fetchStarted && $this->tdbmService->getConnection()->getDatabasePlatform() instanceof MySqlPlatform) {
137 137
             // Optimisation: we don't need a separate "count" SQL request in MySQL.
138 138
             assert($this->result instanceof Result);
139
-            $this->count = (int)$this->result->rowCount();
139
+            $this->count = (int) $this->result->rowCount();
140 140
             return $this->count;
141 141
         }
142 142
         return $this->getRowCountViaSqlQuery();
Please login to merge, or discard this patch.
src/SchemaVersionControl/SchemaBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
                 $foreignColumns = [$foreignColumns];
119 119
             }
120 120
         }
121
-        $options = array_diff_key($constraintDesc, ['column' => 0,'columns' => 0,'references' => 0]);
121
+        $options = array_diff_key($constraintDesc, ['column' => 0, 'columns' => 0, 'references' => 0]);
122 122
         $table->addForeignKeyConstraint($foreignTable, $localColumns, $foreignColumns, $options, $name);
123 123
     }
124 124
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             $name = implode('_', $columns);
154 154
         }
155 155
 
156
-        $options = array_diff_key($indexDesc, ['column' => 0,'columns' => 0]);
156
+        $options = array_diff_key($indexDesc, ['column' => 0, 'columns' => 0]);
157 157
         if (isset($indexDesc['unique']) && $indexDesc['unique'] === true) {
158 158
             $table->addUniqueIndex($columns, $name, [], $options);
159 159
         } else {
Please login to merge, or discard this patch.
src/Utils/TDBMDaoGenerator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -93,11 +93,11 @@  discard block
 block discarded – undo
93 93
 
94 94
         // Remove all beans and daos from junction tables
95 95
         $junctionTables = $this->configuration->getSchemaAnalyzer()->detectJunctionTables(true);
96
-        $junctionTableNames = array_map(function (Table $table) {
96
+        $junctionTableNames = array_map(function(Table $table) {
97 97
             return $table->getName();
98 98
         }, $junctionTables);
99 99
 
100
-        $tableList = array_filter($tableList, function (Table $table) use ($junctionTableNames) {
100
+        $tableList = array_filter($tableList, function(Table $table) use ($junctionTableNames) {
101 101
             return !in_array($table->getName(), $junctionTableNames, true);
102 102
         });
103 103
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         $fileContent = $this->psr2Fix($fileContent);
179 179
         // Add the declare strict-types directive
180 180
         $commentEnd = strpos($fileContent, ' */') + 3;
181
-        $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
181
+        $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
182 182
 
183 183
         $this->dumpFile($possibleBaseFileName, $fileContent);
184 184
 
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $fileContent = $this->psr2Fix($fileContent);
241 241
         // Add the declare strict-types directive
242 242
         $commentEnd = strpos($fileContent, ' */') + 3;
243
-        $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
243
+        $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
244 244
 
245 245
         $this->dumpFile($possibleBaseFileName, $fileContent);
246 246
 
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
     private function psr2Fix(string $content): string
279 279
     {
280 280
         // Removes the extra blank line at the end (before: `\n\n`, after: `\n`)
281
-        return rtrim($content, PHP_EOL) . PHP_EOL;
281
+        return rtrim($content, PHP_EOL).PHP_EOL;
282 282
     }
283 283
 
284 284
     /**
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         $resultIteratorClassName = $beanDescriptor->getResultIteratorClassName();
290 290
         $resultIteratorBaseClassName = $beanDescriptor->getBaseResultIteratorClassName();
291 291
         $resultIteratorNamespace = $this->configuration->getResultIteratorNamespace();
292
-        $resultIteratorBaseNamespace = $resultIteratorNamespace . '\\Generated';
292
+        $resultIteratorBaseNamespace = $resultIteratorNamespace.'\\Generated';
293 293
         $beanClassWithoutNameSpace = $beanDescriptor->getBeanClassName();
294 294
         $file = $beanDescriptor->generateResultIteratorPhpCode();
295 295
         if ($file === null) {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
         $fileContent = $this->psr2Fix($file->generate());
300 300
         $commentEnd = strpos($fileContent, ' */') + 3;
301
-        $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
301
+        $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
302 302
 
303 303
         $baseResultIteratorFilePath = $this->configuration->getPathFinder()->getPath($resultIteratorBaseNamespace.'\\'.$resultIteratorBaseClassName)->getPathname();
304 304
         $this->dumpFile($baseResultIteratorFilePath, $fileContent);
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 
364 364
         $constructorMethod = new MethodGenerator(
365 365
             '__construct',
366
-            [ new ParameterGenerator('container', ContainerInterface::class) ],
366
+            [new ParameterGenerator('container', ContainerInterface::class)],
367 367
             MethodGenerator::FLAG_PUBLIC,
368 368
             '$this->container = $container;'
369 369
         );
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 
380 380
             $daoInstanceProperty = new PropertyGenerator($daoInstanceName);
381 381
             $daoInstanceProperty->setVisibility(AbstractMemberGenerator::VISIBILITY_PRIVATE);
382
-            $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\' . $daoNamespace . '\\' . $daoClassName, 'null'])]));
382
+            $daoInstanceProperty->setDocBlock(new DocBlockGenerator(null, null, [new VarTag(null, ['\\'.$daoNamespace.'\\'.$daoClassName, 'null'])]));
383 383
             $class->addPropertyFromGenerator($daoInstanceProperty);
384 384
 
385 385
             $fullClassNameVarExport = var_export($daoNamespace.'\\'.$daoClassName, true);
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 BODY;
393 393
 
394 394
             $getterMethod = new MethodGenerator(
395
-                'get' . $daoClassName,
395
+                'get'.$daoClassName,
396 396
                 [],
397 397
                 MethodGenerator::FLAG_PUBLIC,
398 398
                 $getterBody
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
             }
405 405
 
406 406
             $setterMethod = new MethodGenerator(
407
-                'set' . $daoClassName,
408
-                [new ParameterGenerator($daoInstanceName, '\\' . $daoNamespace . '\\' . $daoClassName)],
407
+                'set'.$daoClassName,
408
+                [new ParameterGenerator($daoInstanceName, '\\'.$daoNamespace.'\\'.$daoClassName)],
409 409
                 MethodGenerator::FLAG_PUBLIC,
410
-                '$this->' . $daoInstanceName . ' = $' . $daoInstanceName . ';'
410
+                '$this->'.$daoInstanceName.' = $'.$daoInstanceName.';'
411 411
             );
412 412
             $setterMethod->setReturnType('void');
413 413
             $setterMethod = $this->configuration->getCodeGeneratorListener()->onDaoFactorySetterGenerated($setterMethod, $beanDescriptor, $this->configuration, $class);
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
             $fileContent = $this->psr2Fix($fileContent);
428 428
             // Add the declare strict-types directive
429 429
             $commentEnd = strpos($fileContent, ' */') + 3;
430
-            $fileContent = substr($fileContent, 0, $commentEnd) . "\n\ndeclare(strict_types=1);" . substr($fileContent, $commentEnd + 1);
430
+            $fileContent = substr($fileContent, 0, $commentEnd)."\n\ndeclare(strict_types=1);".substr($fileContent, $commentEnd + 1);
431 431
 
432 432
             $this->dumpFile($possibleFileName, $fileContent);
433 433
         }
Please login to merge, or discard this patch.