Passed
Pull Request — master (#70)
by Christian
01:42 queued 19s
created
Maphper/MultiPk.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 	}
25 25
 
26 26
 	public function offsetGet($key) {
27
-		$depth = $this->getDepth()+1;
28
-		if (count($this->primaryKey)-1 == $depth) return $this->mapper->filter([$this->primaryKey[$depth] => $key])->item(0);
27
+		$depth = $this->getDepth() + 1;
28
+		if (count($this->primaryKey) - 1 == $depth) return $this->mapper->filter([$this->primaryKey[$depth] => $key])->item(0);
29 29
 		else return new MultiPk($this->mapper, $key, $this->primaryKey, $this);
30 30
 	}
31 31
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 	public function offsetUnset($key) {
46 46
 		$keys = $this->primaryKey;
47
-		$this->mapper->filter([ array_pop($keys) => $key])->delete();
47
+		$this->mapper->filter([array_pop($keys) => $key])->delete();
48 48
 	}
49 49
 
50 50
 	public function offsetExists($key) {
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,11 @@
 block discarded – undo
25 25
 
26 26
 	public function offsetGet($key) {
27 27
 		$depth = $this->getDepth()+1;
28
-		if (count($this->primaryKey)-1 == $depth) return $this->mapper->filter([$this->primaryKey[$depth] => $key])->item(0);
29
-		else return new MultiPk($this->mapper, $key, $this->primaryKey, $this);
28
+		if (count($this->primaryKey)-1 == $depth) {
29
+			return $this->mapper->filter([$this->primaryKey[$depth] => $key])->item(0);
30
+		} else {
31
+			return new MultiPk($this->mapper, $key, $this->primaryKey, $this);
32
+		}
30 33
 	}
31 34
 
32 35
 	public function offsetSet($key, $value) {
Please login to merge, or discard this patch.
Maphper/DataSource/DatabaseCrud.php 1 patch
Braces   +17 added lines, -9 removed lines patch added patch discarded remove patch
@@ -53,10 +53,13 @@  discard block
 block discarded – undo
53 53
             $result = $this->insert($this->table, $this->primaryKey, $data);
54 54
 
55 55
 			//If there was an error but PDO is silent, trigger the catch block anyway
56
-			if ($result->errorCode() !== '00000') throw new \Exception('Could not insert into ' . $this->table);
57
-		}
58
-		catch (\Exception $e) {
59
-			if (!$this->databaseModify->getTryInsertAgain($tryagain)) throw $e;
56
+			if ($result->errorCode() !== '00000') {
57
+				throw new \Exception('Could not insert into ' . $this->table);
58
+			}
59
+		} catch (\Exception $e) {
60
+			if (!$this->databaseModify->getTryInsertAgain($tryagain)) {
61
+				throw $e;
62
+			}
60 63
 
61 64
 			$this->adapter->alterDatabase($this->table, $this->primaryKey, $data);
62 65
 			$this->save($data, false);
@@ -69,21 +72,24 @@  discard block
 block discarded – undo
69 72
 	}
70 73
 
71 74
     private function updatePK($data, $new) {
72
-        if ($new && count($this->primaryKey) == 1) $data->{$this->primaryKey[0]} = $this->adapter->lastInsertId();
75
+        if ($new && count($this->primaryKey) == 1) {
76
+        	$data->{$this->primaryKey[0]} = $this->adapter->lastInsertId();
77
+        }
73 78
     }
74 79
 
75 80
     private function checkIfUpdateWorked($data) {
76 81
         $updateWhere = $this->whereBuilder->createSql($data);
77 82
         $matched = $this->databaseSelect->findByField($updateWhere['args']);
78
-        if (count($matched) == 0) throw new \InvalidArgumentException('Record inserted into table ' . $this->table . ' fails table constraints');
83
+        if (count($matched) == 0) {
84
+        	throw new \InvalidArgumentException('Record inserted into table ' . $this->table . ' fails table constraints');
85
+        }
79 86
     }
80 87
 
81 88
 	private function insert($table, array $primaryKey, $data) {
82 89
 		$error = 0;
83 90
 		try {
84 91
 			$result = $this->adapter->query($this->crudBuilder->insert($table, $data));
85
-		}
86
-		catch (\Exception $e) {
92
+		} catch (\Exception $e) {
87 93
 			$error = 1;
88 94
 		}
89 95
 
@@ -96,7 +102,9 @@  discard block
 block discarded – undo
96 102
 
97 103
     private function tryUpdate($table, array $primaryKey, $data) {
98 104
         $result = $this->adapter->query($this->crudBuilder->update($table, $primaryKey, $data));
99
-        if ($result->rowCount() === 0) $this->checkIfUpdateWorked($data);
105
+        if ($result->rowCount() === 0) {
106
+        	$this->checkIfUpdateWorked($data);
107
+        }
100 108
 
101 109
         return $result;
102 110
     }
Please login to merge, or discard this patch.
Maphper/DataSource/StmtCache.php 1 patch
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,10 +10,13 @@
 block discarded – undo
10 10
 
11 11
     public function getCachedStmt($sql) {
12 12
 		$queryId = $this->getQueryId($sql);
13
-		if (isset($this->queryCache[$queryId])) $stmt = $this->queryCache[$queryId];
14
-		else {
13
+		if (isset($this->queryCache[$queryId])) {
14
+			$stmt = $this->queryCache[$queryId];
15
+		} else {
15 16
 			$stmt = $this->pdo->prepare($sql, [\PDO::ATTR_CURSOR => \PDO::CURSOR_FWDONLY]);
16
-			if ($stmt) $this->queryCache[$queryId] = $stmt;
17
+			if ($stmt) {
18
+				$this->queryCache[$queryId] = $stmt;
19
+			}
17 20
 		}
18 21
 		return $stmt;
19 22
 	}
Please login to merge, or discard this patch.
Maphper/DataSource/DatabaseModify.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 	}
18 18
 
19 19
     public function optimizeColumns() {
20
-        if (Database::EDIT_OPTIMISE & $this->alterDb && rand(0,500) == 1) $this->adapter->optimiseColumns($this->table);
20
+        if (Database::EDIT_OPTIMISE & $this->alterDb && rand(0, 500) == 1) $this->adapter->optimiseColumns($this->table);
21 21
     }
22 22
 
23 23
     public function getTryInsertAgain($tryagain) {
Please login to merge, or discard this patch.
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,11 +13,15 @@
 block discarded – undo
13 13
     }
14 14
 
15 15
     public function addIndex($args) {
16
-		if (Database::EDIT_INDEX & $this->alterDb) $this->adapter->addIndex($this->table, $args);
16
+		if (Database::EDIT_INDEX & $this->alterDb) {
17
+			$this->adapter->addIndex($this->table, $args);
18
+		}
17 19
 	}
18 20
 
19 21
     public function optimizeColumns() {
20
-        if (Database::EDIT_OPTIMISE & $this->alterDb && rand(0,500) == 1) $this->adapter->optimiseColumns($this->table);
22
+        if (Database::EDIT_OPTIMISE & $this->alterDb && rand(0,500) == 1) {
23
+        	$this->adapter->optimiseColumns($this->table);
24
+        }
21 25
     }
22 26
 
23 27
     public function getTryInsertAgain($tryagain) {
Please login to merge, or discard this patch.
Maphper/DataSource/SqliteAdapter.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 
42 42
 	private function tableExists($name) {
43
-		$result = $this->pdo->query('SELECT name FROM sqlite_master WHERE type="table" and name="'. $name.'"');
43
+		$result = $this->pdo->query('SELECT name FROM sqlite_master WHERE type="table" and name="' . $name . '"');
44 44
 		return count($result->fetchAll()) == 1;
45 45
 	}
46 46
 
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 		$this->stmtCache->clearCache();
61 61
 
62 62
         // Create temp table to create a new structure
63
-		$affix = '_'.substr(md5($table), 0, 6);
63
+		$affix = '_' . substr(md5($table), 0, 6);
64 64
         $tempTable = $table . $affix;
65 65
 		$this->generalEditor->createTable($tempTable, $primaryKey, $data);
66 66
         $this->alterColumns($tempTable, $primaryKey, $data);
67 67
 		$this->copyTableData($table, $tempTable);
68 68
 
69
-		$this->pdo->query('DROP TABLE IF EXISTS ' . $table );
70
-		$this->pdo->query('ALTER TABLE ' . $tempTable . ' RENAME TO '. $table );
69
+		$this->pdo->query('DROP TABLE IF EXISTS ' . $table);
70
+		$this->pdo->query('ALTER TABLE ' . $tempTable . ' RENAME TO ' . $table);
71 71
 
72 72
 	}
73 73
 
Please login to merge, or discard this patch.
Braces   +14 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,7 +24,9 @@  discard block
 block discarded – undo
24 24
 		$args = $query->getArgs();
25 25
 
26 26
         //Handle SQLite when PDO_ERRMODE is set to SILENT
27
-        if ($stmt === false) throw new \Exception('Invalid query');
27
+        if ($stmt === false) {
28
+        	throw new \Exception('Invalid query');
29
+        }
28 30
 
29 31
         $stmt->execute($args);
30 32
         if ($stmt->errorCode() !== '00000' && $stmt->errorInfo()[2] == 'database schema has changed') {
@@ -78,8 +80,7 @@  discard block
 block discarded – undo
78 80
 
79 81
 				$this->pdo->query('INSERT INTO ' . $this->quote($tableTo) . '(' . $columns . ') SELECT ' . $columns . ' FROM ' . $this->quote($tableFrom));
80 82
 			}
81
-		}
82
-		catch (\PDOException $e) {
83
+		} catch (\PDOException $e) {
83 84
 			// No data to copy
84 85
 			echo $e->getMessage();
85 86
 		}
@@ -87,7 +88,9 @@  discard block
 block discarded – undo
87 88
 
88 89
     private function alterColumns($table, array $primaryKey, $data) {
89 90
         foreach ($data as $key => $value) {
90
-			if ($this->generalEditor->isNotSavableType($value, $key, $primaryKey)) continue;
91
+			if ($this->generalEditor->isNotSavableType($value, $key, $primaryKey)) {
92
+				continue;
93
+			}
91 94
 
92 95
 			$type = $this->generalEditor->getType($value);
93 96
 
@@ -96,10 +99,14 @@  discard block
 block discarded – undo
96 99
     }
97 100
 
98 101
     public function addIndex($table, array $fields) {
99
-		if (empty($fields)) return false;
102
+		if (empty($fields)) {
103
+			return false;
104
+		}
100 105
 
101 106
 		//SQLite doesn't support ASC/DESC indexes, remove the keywords
102
-		foreach ($fields as &$field) $field = str_ireplace([' desc', ' asc'], '', $field);
107
+		foreach ($fields as &$field) {
108
+			$field = str_ireplace([' desc', ' asc'], '', $field);
109
+		}
103 110
 		sort($fields);
104 111
 		$fields = array_map('strtolower', $fields);
105 112
 		$fields = array_map('trim', $fields);
@@ -108,8 +115,7 @@  discard block
 block discarded – undo
108 115
 
109 116
 		try {
110 117
 			$this->pdo->query('CREATE INDEX IF NOT EXISTS  ' . $keyName . ' ON ' . $table . ' (' . implode(', ', $fields) . ')');
111
-		}
112
-		catch (\Exception $e) {
118
+		} catch (\Exception $e) {
113 119
 
114 120
 		}
115 121
 	}
Please login to merge, or discard this patch.
Maphper/DataSource/MysqlAdapter.php 1 patch
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,9 @@  discard block
 block discarded – undo
27 27
 
28 28
     private function alterColumns($table, array $primaryKey, $data) {
29 29
         foreach ($data as $key => $value) {
30
-			if ($this->generalEditor->isNotSavableType($value, $key, $primaryKey)) continue;
30
+			if ($this->generalEditor->isNotSavableType($value, $key, $primaryKey)) {
31
+				continue;
32
+			}
31 33
             
32 34
 			$type = $this->generalEditor->getType($value);
33 35
 			$this->tryAlteringColumn($table, $key, $type);
@@ -36,9 +38,10 @@  discard block
 block discarded – undo
36 38
 
37 39
     private function tryAlteringColumn($table, $key, $type) {
38 40
         try {
39
-            if (!$this->pdo->query('ALTER TABLE ' . $table . ' ADD ' . $this->quote($key) . ' ' . $type)) throw new \Exception('Could not alter table');
40
-        }
41
-        catch (\Exception $e) {
41
+            if (!$this->pdo->query('ALTER TABLE ' . $table . ' ADD ' . $this->quote($key) . ' ' . $type)) {
42
+            	throw new \Exception('Could not alter table');
43
+            }
44
+        } catch (\Exception $e) {
42 45
             $this->pdo->query('ALTER TABLE ' . $table . ' MODIFY ' . $this->quote($key) . ' ' . $type);
43 46
         }
44 47
     }
@@ -60,7 +63,9 @@  discard block
 block discarded – undo
60 63
 		$keyName = $this->quote(implode('_', $fields));
61 64
 
62 65
 		$results = $this->pdo->query('SHOW INDEX FROM ' . $this->quote($table) . ' WHERE Key_Name = "' . $keyName . '"');
63
-		if ($results && count($results->fetchAll()) == 0)  $this->pdo->query('CREATE INDEX ' . $keyName . ' ON ' . $this->quote($table) . ' (' . implode(', ', $fields) . ')');
66
+		if ($results && count($results->fetchAll()) == 0) {
67
+			$this->pdo->query('CREATE INDEX ' . $keyName . ' ON ' . $this->quote($table) . ' (' . implode(', ', $fields) . ')');
68
+		}
64 69
 	}
65 70
 
66 71
 	public function optimiseColumns($table) {
Please login to merge, or discard this patch.
Maphper/Maphper.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 namespace Maphper;
3 3
 class Maphper implements \Countable, \ArrayAccess, \IteratorAggregate {
4
-	const FIND_EXACT 		= 	0x1;
5
-	const FIND_LIKE 		= 	0x2;
6
-	const FIND_STARTS 		= 	0x4;
7
-	const FIND_ENDS 		= 	0x8;
8
-	const FIND_BIT 			= 	0x10;
9
-	const FIND_GREATER 		= 	0x20;
10
-	const FIND_LESS 		=	0x40;
11
-	const FIND_EXPRESSION 	= 	0x80;
12
-	const FIND_AND 			= 	0x100;
13
-	const FIND_OR 			= 	0x200;
14
-	const FIND_NOT 			= 	0x400;
15
-	const FIND_BETWEEN		= 	0x800;
16
-	const FIND_NOCASE		= 	0x1000;
4
+	const FIND_EXACT = 0x1;
5
+	const FIND_LIKE 		= 0x2;
6
+	const FIND_STARTS = 0x4;
7
+	const FIND_ENDS 		= 0x8;
8
+	const FIND_BIT 			= 0x10;
9
+	const FIND_GREATER = 0x20;
10
+	const FIND_LESS 		= 0x40;
11
+	const FIND_EXPRESSION = 0x80;
12
+	const FIND_AND 			= 0x100;
13
+	const FIND_OR = 0x200;
14
+	const FIND_NOT 			= 0x400;
15
+	const FIND_BETWEEN = 0x800;
16
+	const FIND_NOCASE		= 0x1000;
17 17
 
18 18
 	private $dataSource;
19 19
 	private $relations = [];
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 			}
58 58
 		}
59 59
 		$results = $this->dataSource->findByField($this->settings['filter'],
60
-			['order' => $this->settings['sort'], 'limit' => $this->settings['limit'], 'offset' => $this->settings['offset'] ]);
60
+			['order' => $this->settings['sort'], 'limit' => $this->settings['limit'], 'offset' => $this->settings['offset']]);
61 61
 
62 62
 		$siblings = new \ArrayObject();
63 63
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             $data = $this->dataSource->findByField(array_merge($this->settings['filter'], [$this->dataSource->getPrimaryKey()[0] => $offset]));
109 109
             return isset($data[0]);
110 110
         }
111
-		return (bool) $this->dataSource->findById($offset);
111
+		return (bool)$this->dataSource->findById($offset);
112 112
 	}
113 113
 
114 114
 	public function offsetUnset($id) {
Please login to merge, or discard this patch.
Braces   +31 added lines, -12 removed lines patch added patch discarded remove patch
@@ -60,7 +60,9 @@  discard block
 block discarded – undo
60 60
 
61 61
 		$siblings = new \ArrayObject();
62 62
 
63
-		foreach ($results as &$result) $result = $this->entity->create($result, $this->relations, $siblings);
63
+		foreach ($results as &$result) {
64
+			$result = $this->entity->create($result, $this->relations, $siblings);
65
+		}
64 66
 
65 67
 		return $results;
66 68
 	}
@@ -77,13 +79,17 @@  discard block
 block discarded – undo
77 79
 	private function processFilters($value) {
78 80
 		//When saving to a mapper with filters, write the filters back into the object being stored
79 81
 		foreach ($this->settings['filter'] as $key => $filterValue) {
80
-			if (empty($value->$key) && !is_array($filterValue)) $value->$key = $filterValue;
82
+			if (empty($value->$key) && !is_array($filterValue)) {
83
+				$value->$key = $filterValue;
84
+			}
81 85
 		}
82 86
 		return $value;
83 87
 	}
84 88
 
85 89
 	public function offsetSet($offset, $valueObj) {
86
-        if ($valueObj instanceof \Maphper\Relation) throw new \Exception();
90
+        if ($valueObj instanceof \Maphper\Relation) {
91
+        	throw new \Exception();
92
+        }
87 93
 
88 94
         //Extract private properties from the object
89 95
         $visibilityOverride = new \Maphper\Lib\VisibilityOverride($valueObj);
@@ -91,7 +97,9 @@  discard block
 block discarded – undo
91 97
 
92 98
         $value = $this->processFilters($value);
93 99
         $pk = $this->dataSource->getPrimaryKey();
94
-        if ($offset !== null) $value->{$pk[0]} = $offset;
100
+        if ($offset !== null) {
101
+        	$value->{$pk[0]} = $offset;
102
+        }
95 103
         $valueCopy = $this->removeRelations(clone $value, $pk);
96 104
         $value = $this->entity->wrap($this->relations, $value);
97 105
         $this->dataSource->save($value);
@@ -101,15 +109,20 @@  discard block
 block discarded – undo
101 109
 	}
102 110
 
103 111
 	private function removeRelations($obj, $pk) { // Prevent saving ManyMany twice except when pk isn't initially set
104
-		foreach ($this->relations as $name => $relation)
105
-			if ($relation instanceOf \Maphper\Relation\ManyMany && isset($obj->$name) && !empty($obj->{$pk[0]})) unset($obj->$name);
112
+		foreach ($this->relations as $name => $relation) {
113
+					if ($relation instanceOf \Maphper\Relation\ManyMany && isset($obj->$name) && !empty($obj->{$pk[0]})) unset($obj->$name);
114
+		}
106 115
 
107
-		if (empty($obj->{$pk[0]})) unset($obj->{$pk[0]});
116
+		if (empty($obj->{$pk[0]})) {
117
+			unset($obj->{$pk[0]});
118
+		}
108 119
 		return $obj;
109 120
 	}
110 121
 
111 122
 	public function offsetExists($offset) {
112
-		if (count($this->dataSource->getPrimaryKey()) > 1) return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey());
123
+		if (count($this->dataSource->getPrimaryKey()) > 1) {
124
+			return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey());
125
+		}
113 126
         if (!empty($this->settings['filter'])) {
114 127
             $data = $this->dataSource->findByField(array_merge($this->settings['filter'], [$this->dataSource->getPrimaryKey()[0] => $offset]));
115 128
             return isset($data[0]);
@@ -122,7 +135,9 @@  discard block
 block discarded – undo
122 135
 	}
123 136
 
124 137
 	public function offsetGet($offset) {
125
-		if (count($this->dataSource->getPrimaryKey()) > 1) return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey());
138
+		if (count($this->dataSource->getPrimaryKey()) > 1) {
139
+			return new MultiPk($this, $offset, $this->dataSource->getPrimaryKey());
140
+		}
126 141
         if (!empty($this->settings['filter'])) {
127 142
             $data = $this->dataSource->findByField(array_merge($this->settings['filter'], [$this->dataSource->getPrimaryKey()[0] => $offset]));
128 143
             return $this->entity->create(isset($data[0]) ? $data[0] : null, $this->relations);
@@ -133,11 +148,15 @@  discard block
 block discarded – undo
133 148
 	public function __call($method, $args) {
134 149
 		if (array_key_exists($method, $this->settings)) {
135 150
 			$maphper = new Maphper($this->dataSource, $this->settings, $this->relations);
136
-			if (is_array($maphper->settings[$method])) $maphper->settings[$method] = $args[0] + $maphper->settings[$method];
137
-			else $maphper->settings[$method] = $args[0];
151
+			if (is_array($maphper->settings[$method])) {
152
+				$maphper->settings[$method] = $args[0] + $maphper->settings[$method];
153
+			} else {
154
+				$maphper->settings[$method] = $args[0];
155
+			}
138 156
 			return $maphper;
157
+		} else {
158
+			throw new \Exception('Method Maphper::' . $method . ' does not exist');
139 159
 		}
140
-		else throw new \Exception('Method Maphper::' . $method . ' does not exist');
141 160
 	}
142 161
 
143 162
 	public function findAggregate($function, $field, $group = null) {
Please login to merge, or discard this patch.
Maphper/Iterator.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,8 +20,7 @@
 block discarded – undo
20 20
 		if (count($this->pk) == 1) {
21 21
 			$pk = end($this->pk);
22 22
 			return $this->array[$this->iterator]->$pk;
23
-		}
24
-		else {
23
+		} else {
25 24
 			$current = $this->current();
26 25
 			return array_map(function($pkName) use ($current) {
27 26
 				return $current->$pkName;
Please login to merge, or discard this patch.
Maphper/Lib/SelectBuilder.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,17 +7,23 @@
 block discarded – undo
7 7
 
8 8
 		if (isset($options['offset'])) {
9 9
 			$offset = ' OFFSET ' . $options['offset'];
10
-			if (!$limit) $limit = ' LIMIT  1000';
10
+			if (!$limit) {
11
+				$limit = ' LIMIT  1000';
12
+			}
13
+		} else {
14
+			$offset = '';
11 15
 		}
12
-		else $offset = '';
13 16
 
14 17
 		$order = isset($options['order']) ? ' ORDER BY ' . $options['order'] : '';
15 18
 		return new Query('SELECT * FROM ' . $table . ' ' . $where . $order . $limit . $offset, $args);
16 19
 	}
17 20
 
18 21
 	public function aggregate($table, $function, $field, $where, $args, $group) {
19
-		if ($group == true) $groupBy = ' GROUP BY ' . $field;
20
-		else $groupBy = '';
22
+		if ($group == true) {
23
+			$groupBy = ' GROUP BY ' . $field;
24
+		} else {
25
+			$groupBy = '';
26
+		}
21 27
 		return new Query('SELECT ' . $function . '(' . $field . ') as val, ' . $field . '   FROM ' . $table . ($where != null ? ' WHERE ' . $where : '') . ' ' . $groupBy, $args);
22 28
 	}
23 29
 }
Please login to merge, or discard this patch.