Passed
Push — master ( fabf78...ec4e31 )
by Adrian
01:22
created
src/Traits/GroupBy.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
 	 * @return $this
27 27
 	 * @throws QueryException
28 28
 	 */
29
-	public function groupBy( $column, array $allowedColumns = [] )
29
+	public function groupBy( $column, array $allowedColumns = [ ] )
30 30
 	{
31 31
 		if ( !$this->validateColumn( $column, $allowedColumns ) )
32 32
 			throw new QueryException( 'Invalid column name in GROUP BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME );
33 33
 
34
-		$column = $this->queryStructure->prepare($column);
34
+		$column = $this->queryStructure->prepare( $column );
35 35
 		$this->queryStructure->setElement( QueryStructure::ORDER_BY, $column );
36 36
 
37 37
 		$this->queryStructure->setElement( QueryStructure::GROUP_BY, $column );
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 	 * @return $this
47 47
 	 * @throws QueryException
48 48
 	 */
49
-	public function groupByDesc( $column, array $allowedColumns = [] )
49
+	public function groupByDesc( $column, array $allowedColumns = [ ] )
50 50
 	{
51 51
 		if ( !$this->validateColumn( $column, $allowedColumns ) )
52 52
 			throw new QueryException( 'Invalid column name in GROUP BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME );
53 53
 
54
-		$column = $this->queryStructure->prepare($column);
54
+		$column = $this->queryStructure->prepare( $column );
55 55
 		$this->queryStructure->setElement( QueryStructure::ORDER_BY, $column );
56 56
 
57 57
 		$this->queryStructure->setElement( QueryStructure::GROUP_BY, $column . ' DESC' );
Please login to merge, or discard this patch.
src/Abstracts/AbstractTableDao.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	public function __construct()
39 39
 	{
40 40
 		$this->table = $this->getTableName();
41
-		$this->primary = (array)$this->getPrimaryKey();
41
+		$this->primary = ( array ) $this->getPrimaryKey();
42 42
 		$this->orderField = $this->getOrderField();
43 43
 	}
44 44
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	 * @return array|bool
66 66
 	 * @throws QueryException
67 67
 	 */
68
-	public function getRowById( $id, array $fields = [] )
68
+	public function getRowById( $id, array $fields = [ ] )
69 69
 	{
70 70
 		$conditions = $this->getPrimaryKeyConditions( $id );
71 71
 		$result = QueryBuild::select( $this->table )->fields( $fields );
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
 			throw new QueryException( 'Order field is not defined' );
131 131
 
132 132
 		$query = /** @lang text */
133
-			"UPDATE `{$this->table}` SET `{$this->orderField}` = CASE `{$this->primary[0]}` \r\n";
133
+			"UPDATE `{$this->table}` SET `{$this->orderField}` = CASE `{$this->primary[ 0 ]}` \r\n";
134 134
 		foreach ( $updates_ord as $position => $id ) {
135 135
 			$pos = $position + 1;
136 136
 			$query .= " WHEN '$id' THEN '$pos' \r\n";
137 137
 		}
138 138
 		$query .= "ELSE `{$this->orderField}` END";
139 139
 
140
-		return PdoWrapperService::getInstance()->query($query, []);
140
+		return PdoWrapperService::getInstance()->query( $query, [ ] );
141 141
 	}
142 142
 
143 143
 
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
 	protected function getPrimaryKeyConditions( $id )
150 150
 	{
151 151
 
152
-		$id = (array)$id;
152
+		$id = ( array ) $id;
153 153
 
154 154
 		if ( count( $this->primary ) !== count( $id ) )
155 155
 			throw new QueryException( 'Invalid primary key', QueryException::QUERY_CRUD_INVALID_PRIMARY );
156 156
 
157
-		$conditions = [];
157
+		$conditions = [ ];
158 158
 
159 159
 		foreach ( $this->primary as $index => $key )
160 160
 			$conditions[ $key ] = $id[ $index ];
Please login to merge, or discard this patch.