Completed
Push — 4.0 ( 9c3405...18ff8e )
by David
02:23
created
src/Mouf/Database/TDBM/Utils/BeanDescriptor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function getConstructorProperties()
94 94
     {
95
-        $constructorProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) {
95
+        $constructorProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) {
96 96
            return $property->isCompulsory();
97 97
         });
98 98
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     public function getPropertiesWithDefault()
108 108
     {
109 109
         $properties = $this->getPropertiesForTable($this->table);
110
-        $defaultProperties = array_filter($properties, function (AbstractBeanPropertyDescriptor $property) {
110
+        $defaultProperties = array_filter($properties, function(AbstractBeanPropertyDescriptor $property) {
111 111
             return $property->hasDefault();
112 112
         });
113 113
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function getExposedProperties()
123 123
     {
124
-        $exposedProperties = array_filter($this->beanPropertyDescriptors, function (AbstractBeanPropertyDescriptor $property) {
124
+        $exposedProperties = array_filter($this->beanPropertyDescriptors, function(AbstractBeanPropertyDescriptor $property) {
125 125
             return $property->getTable()->getName() == $this->table->getName();
126 126
         });
127 127
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
         $fksByMethodName = [];
292 292
 
293 293
         foreach ($fksByTable as $tableName => $fksForTable) {
294
-            if (count($fksForTable) > 1) {
294
+            if (count($fksForTable)>1) {
295 295
                 foreach ($fksForTable as $fk) {
296 296
                     $methodName = 'get'.TDBMDaoGenerator::toCamelCase($fk->getLocalTableName()).'By';
297 297
 
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
         $finalDescs = [];
407 407
         foreach ($descs as $descArray) {
408
-            if (count($descArray) > 1) {
408
+            if (count($descArray)>1) {
409 409
                 foreach ($descArray as $desc) {
410 410
                     $desc['name'] = TDBMDaoGenerator::toCamelCase($desc['remoteFK']->getForeignTableName()).'By'.TDBMDaoGenerator::toCamelCase($desc['table']->getName());
411 411
                     $finalDescs[] = $desc;
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 
579 579
         $classes = $this->generateExtendsAndUseStatements($parentFk);
580 580
 
581
-        $uses = array_map(function ($className) use ($beannamespace) { return 'use '.$beannamespace.'\\'.$className.";\n"; }, $classes);
581
+        $uses = array_map(function($className) use ($beannamespace) { return 'use '.$beannamespace.'\\'.$className.";\n"; }, $classes);
582 582
         $use = implode('', $uses);
583 583
 
584 584
         if ($parentFk !== null) {
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/TDBMService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
         sort($tables);
1017 1017
 
1018 1018
         return $this->fromCache($this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables),
1019
-            function () use ($tables) {
1019
+            function() use ($tables) {
1020 1020
                 return $this->_getLinkBetweenInheritedTablesWithoutCache($tables);
1021 1021
             });
1022 1022
     }
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
      */
1064 1064
     public function _getRelatedTablesByInheritance($table)
1065 1065
     {
1066
-        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) {
1066
+        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) {
1067 1067
             return $this->_getRelatedTablesByInheritanceWithoutCache($table);
1068 1068
         });
1069 1069
     }
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
         $objects = $this->findObjects($mainTable, $filter, $parameters, null, $additionalTablesFetch, self::MODE_ARRAY, $className);
1348 1348
         $page = $objects->take(0, 2);
1349 1349
         $count = $page->count();
1350
-        if ($count > 1) {
1350
+        if ($count>1) {
1351 1351
             throw new DuplicateRowException("Error while querying an object for table '$mainTable': More than 1 row have been returned, but we should have received at most one.");
1352 1352
         } elseif ($count === 0) {
1353 1353
             return;
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
         $remoteTable = $remoteFk->getForeignTableName();
1465 1465
 
1466 1466
         $primaryKeys = $this->getPrimaryKeyValues($bean);
1467
-        $columnNames = array_map(function ($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns());
1467
+        $columnNames = array_map(function($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns());
1468 1468
 
1469 1469
         $filter = array_combine($columnNames, $primaryKeys);
1470 1470
 
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
         $table1 = $fks[0]->getForeignTableName();
1486 1486
         $table2 = $fks[1]->getForeignTableName();
1487 1487
 
1488
-        $beanTables = array_map(function (DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows());
1488
+        $beanTables = array_map(function(DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows());
1489 1489
 
1490 1490
         if (in_array($table1, $beanTables)) {
1491 1491
             return [$fks[0], $fks[1]];
@@ -1541,7 +1541,7 @@  discard block
 block discarded – undo
1541 1541
     {
1542 1542
         if (!isset($typesForTable[$tableName])) {
1543 1543
             $columns = $this->tdbmSchemaAnalyzer->getSchema()->getTable($tableName)->getColumns();
1544
-            $typesForTable[$tableName] = array_map(function (Column $column) {
1544
+            $typesForTable[$tableName] = array_map(function(Column $column) {
1545 1545
                 return $column->getType();
1546 1546
             }, $columns);
1547 1547
         }
Please login to merge, or discard this patch.