Completed
Push — 4.0 ( f56a63...850844 )
by David
03:02
created
src/Mouf/Database/TDBM/TDBMService.php 2 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
      * This is used internally by TDBM to add an object to the list of objects that have been
582 582
      * created/updated but not saved yet.
583 583
      *
584
-     * @param AbstractTDBMObject $myObject
584
+     * @param DbRow $myObject
585 585
      */
586 586
     public function _addToToSaveObjectList(DbRow $myObject)
587 587
     {
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
     /**
1333 1333
      * Returns the column list that must be fetched for the SQL request.
1334 1334
      *
1335
-     * @param $mainTable
1335
+     * @param string $mainTable
1336 1336
      * @param array $additionalTablesFetch
1337 1337
      *
1338 1338
      * @return array
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
     }
1388 1388
 
1389 1389
     /**
1390
-     * @param $table
1390
+     * @param string $table
1391 1391
      * @param array  $primaryKeys
1392 1392
      * @param array  $additionalTablesFetch
1393 1393
      * @param bool   $lazy                  Whether to perform lazy loading on this object or not.
@@ -1591,7 +1591,7 @@  discard block
 block discarded – undo
1591 1591
      * @param $pivotTableName
1592 1592
      * @param AbstractTDBMObject $bean
1593 1593
      *
1594
-     * @return AbstractTDBMObject[]
1594
+     * @return ResultIterator
1595 1595
      */
1596 1596
     public function _getRelatedBeans($pivotTableName, AbstractTDBMObject $bean)
1597 1597
     {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
         sort($tables);
1027 1027
 
1028 1028
         return $this->fromCache($this->cachePrefix.'_linkbetweeninheritedtables_'.implode('__split__', $tables),
1029
-            function () use ($tables) {
1029
+            function() use ($tables) {
1030 1030
                 return $this->_getLinkBetweenInheritedTablesWithoutCache($tables);
1031 1031
             });
1032 1032
     }
@@ -1073,7 +1073,7 @@  discard block
 block discarded – undo
1073 1073
      */
1074 1074
     public function _getRelatedTablesByInheritance($table)
1075 1075
     {
1076
-        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function () use ($table) {
1076
+        return $this->fromCache($this->cachePrefix.'_relatedtables_'.$table, function() use ($table) {
1077 1077
             return $this->_getRelatedTablesByInheritanceWithoutCache($table);
1078 1078
         });
1079 1079
     }
@@ -1132,7 +1132,7 @@  discard block
 block discarded – undo
1132 1132
      */
1133 1133
     private function getParentRelationshipForeignKeys($tableName)
1134 1134
     {
1135
-        return $this->fromCache($this->cachePrefix.'_parentrelationshipfks_'.$tableName, function () use ($tableName) {
1135
+        return $this->fromCache($this->cachePrefix.'_parentrelationshipfks_'.$tableName, function() use ($tableName) {
1136 1136
             return $this->getParentRelationshipForeignKeysWithoutCache($tableName);
1137 1137
         });
1138 1138
     }
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
      */
1162 1162
     private function getChildrenRelationshipForeignKeys($tableName)
1163 1163
     {
1164
-        return $this->fromCache($this->cachePrefix.'_childrenrelationshipfks_'.$tableName, function () use ($tableName) {
1164
+        return $this->fromCache($this->cachePrefix.'_childrenrelationshipfks_'.$tableName, function() use ($tableName) {
1165 1165
             return $this->getChildrenRelationshipForeignKeysWithoutCache($tableName);
1166 1166
         });
1167 1167
     }
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
         $children = $this->schemaAnalyzer->getChildrenRelationships($tableName);
1177 1177
 
1178 1178
         if (!empty($children)) {
1179
-            $fksTables = array_map(function (ForeignKeyConstraint $fk) {
1179
+            $fksTables = array_map(function(ForeignKeyConstraint $fk) {
1180 1180
                 return $this->getChildrenRelationshipForeignKeys($fk->getLocalTableName());
1181 1181
             }, $children);
1182 1182
 
@@ -1539,7 +1539,7 @@  discard block
 block discarded – undo
1539 1539
         $objects = $this->findObjects($mainTable, $filter, $parameters, null, $additionalTablesFetch, self::MODE_ARRAY, $className);
1540 1540
         $page = $objects->take(0, 2);
1541 1541
         $count = $page->count();
1542
-        if ($count > 1) {
1542
+        if ($count>1) {
1543 1543
             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.");
1544 1544
         } elseif ($count === 0) {
1545 1545
             return;
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
         $objects = $this->findObjectsFromSql($mainTable, $from, $filter, $parameters, null, self::MODE_ARRAY, $className);
1567 1567
         $page = $objects->take(0, 2);
1568 1568
         $count = $page->count();
1569
-        if ($count > 1) {
1569
+        if ($count>1) {
1570 1570
             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.");
1571 1571
         } elseif ($count === 0) {
1572 1572
             return;
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
         $remoteTable = $remoteFk->getForeignTableName();
1684 1684
 
1685 1685
         $primaryKeys = $this->getPrimaryKeyValues($bean);
1686
-        $columnNames = array_map(function ($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns());
1686
+        $columnNames = array_map(function($name) use ($pivotTableName) { return $pivotTableName.'.'.$name; }, $localFk->getLocalColumns());
1687 1687
 
1688 1688
         $filter = array_combine($columnNames, $primaryKeys);
1689 1689
 
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
         $table1 = $fks[0]->getForeignTableName();
1705 1705
         $table2 = $fks[1]->getForeignTableName();
1706 1706
 
1707
-        $beanTables = array_map(function (DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows());
1707
+        $beanTables = array_map(function(DbRow $dbRow) { return $dbRow->_getDbTableName(); }, $bean->_getDbRows());
1708 1708
 
1709 1709
         if (in_array($table1, $beanTables)) {
1710 1710
             return [$fks[0], $fks[1]];
@@ -1760,7 +1760,7 @@  discard block
 block discarded – undo
1760 1760
     {
1761 1761
         if (!isset($typesForTable[$tableName])) {
1762 1762
             $columns = $this->tdbmSchemaAnalyzer->getSchema()->getTable($tableName)->getColumns();
1763
-            $typesForTable[$tableName] = array_map(function (Column $column) {
1763
+            $typesForTable[$tableName] = array_map(function(Column $column) {
1764 1764
                 return $column->getType();
1765 1765
             }, $columns);
1766 1766
         }
Please login to merge, or discard this patch.