Completed
Pull Request — 4.3 (#149)
by Dorian
13:16
created
src/Mouf/Database/TDBM/QueryFactory/FindObjectsFromSqlQueryFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 
47 47
         // Let's compute the COUNT.
48 48
         $pkColumnNames = $this->schema->getTable($this->mainTable)->getPrimaryKeyColumns();
49
-        $pkColumnNames = array_map(function ($pkColumn) {
49
+        $pkColumnNames = array_map(function($pkColumn) {
50 50
             return $this->tdbmService->getConnection()->quoteIdentifier($this->mainTable).'.'.$this->tdbmService->getConnection()->quoteIdentifier($pkColumn);
51 51
         }, $pkColumnNames);
52 52
 
53 53
         $countSql = 'SELECT COUNT(DISTINCT '.implode(', ', $pkColumnNames).') FROM '.$this->from;
54 54
 
55 55
         // Add joins on inherited tables if necessary
56
-        if (count($allFetchedTables) > 1) {
56
+        if (count($allFetchedTables)>1) {
57 57
             $joinSql = '';
58 58
             $parentFks = $this->getParentRelationshipForeignKeys($this->mainTable);
59 59
             foreach ($parentFks as $fk) {
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      */
106 106
     private function getParentRelationshipForeignKeys($tableName)
107 107
     {
108
-        return $this->fromCache($this->cachePrefix.'_parentrelationshipfks_'.$tableName, function () use ($tableName) {
108
+        return $this->fromCache($this->cachePrefix.'_parentrelationshipfks_'.$tableName, function() use ($tableName) {
109 109
             return $this->getParentRelationshipForeignKeysWithoutCache($tableName);
110 110
         });
111 111
     }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      */
135 135
     private function getChildrenRelationshipForeignKeys(string $tableName) : array
136 136
     {
137
-        return $this->fromCache($this->cachePrefix.'_childrenrelationshipfks_'.$tableName, function () use ($tableName) {
137
+        return $this->fromCache($this->cachePrefix.'_childrenrelationshipfks_'.$tableName, function() use ($tableName) {
138 138
             return $this->getChildrenRelationshipForeignKeysWithoutCache($tableName);
139 139
         });
140 140
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $children = $this->schemaAnalyzer->getChildrenRelationships($tableName);
150 150
 
151 151
         if (!empty($children)) {
152
-            $fksTables = array_map(function (ForeignKeyConstraint $fk) {
152
+            $fksTables = array_map(function(ForeignKeyConstraint $fk) {
153 153
                 return $this->getChildrenRelationshipForeignKeys($fk->getLocalTableName());
154 154
             }, $children);
155 155
 
Please login to merge, or discard this patch.
src/Mouf/Database/TDBM/QueryFactory/FindObjectsFromRawSqlQueryFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             throw new TDBMException('Missing tables '.implode(', ', $missingTables).' in SELECT statement');
180 180
         }
181 181
 
182
-        for ($i = 0; $i < count($formattedSelect) - 1; $i++) {
182
+        for ($i = 0; $i<count($formattedSelect)-1; $i++) {
183 183
             $formattedSelect[$i]['delim'] = ',';
184 184
         }
185 185
         return [$formattedSelect, $columnDescritors];
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             'base_expr' => 'COUNT',
212 212
             'sub_tree' => $parsedSql['SELECT'],
213 213
             'delim' => false,
214
-        ]];;
214
+        ]]; ;
215 215
     }
216 216
 
217 217
     private function generateGroupedSqlCount($parsedSql)
Please login to merge, or discard this patch.