Passed
Push — master ( bffbee...0a6ac4 )
by Adrian
01:51
created
src/DB/DbService.php 1 patch
Braces   +21 added lines, -20 removed lines patch added patch discarded remove patch
@@ -93,8 +93,9 @@  discard block
 block discarded – undo
93 93
 	{
94 94
 		$this->queryInit( $query, $params );
95 95
 
96
-		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN )
97
-			return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
96
+		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN ) {
97
+					return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
98
+		}
98 99
 
99 100
 		$Columns = $this->sQuery->fetchAll( \PDO::FETCH_NUM );
100 101
 
@@ -117,8 +118,9 @@  discard block
 block discarded – undo
117 118
 	{
118 119
 		$this->queryInit( $query, $params );
119 120
 
120
-		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN )
121
-			return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
121
+		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN ) {
122
+					return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
123
+		}
122 124
 
123 125
 		$result = $this->sQuery->fetch( $fetchmode );
124 126
 		$this->sQuery->closeCursor(); // Frees up the connection to the server so that other SQL statements may be issued,
@@ -135,8 +137,9 @@  discard block
 block discarded – undo
135 137
 	{
136 138
 		$this->queryInit( $query, $params );
137 139
 
138
-		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN )
139
-			return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
140
+		if ( $this->lastStatement === self::QUERY_TYPE_EXPLAIN ) {
141
+					return $this->sQuery->fetchAll( \PDO::FETCH_ASSOC );
142
+		}
140 143
 
141 144
 		$result = $this->sQuery->fetchColumn();
142 145
 		$this->sQuery->closeCursor(); // Frees up the connection to the server so that other SQL statements may be issued
@@ -192,24 +195,22 @@  discard block
 block discarded – undo
192 195
 			/**
193 196
 			 * Add parameters to the parameter array
194 197
 			 */
195
-			if ( self::isArrayAssoc( $parameters ) )
196
-				$this->bindMore( $parameters );
197
-			else
198
-				foreach ( $parameters as $key => $val )
198
+			if ( self::isArrayAssoc( $parameters ) ) {
199
+							$this->bindMore( $parameters );
200
+			} else {
201
+							foreach ( $parameters as $key => $val )
199 202
 					$this->parameters[] = array( $key + 1, $val );
203
+			}
200 204
 
201 205
 			if ( count( $this->parameters ) ) {
202 206
 				foreach ( $this->parameters as $param => $value ) {
203 207
 					if ( is_int( $value[ 1 ] ) ) {
204 208
 						$type = \PDO::PARAM_INT;
205
-					}
206
-					elseif ( is_bool( $value[ 1 ] ) ) {
209
+					} elseif ( is_bool( $value[ 1 ] ) ) {
207 210
 						$type = \PDO::PARAM_BOOL;
208
-					}
209
-					elseif ( is_null( $value[ 1 ] ) ) {
211
+					} elseif ( is_null( $value[ 1 ] ) ) {
210 212
 						$type = \PDO::PARAM_NULL;
211
-					}
212
-					else {
213
+					} else {
213 214
 						$type = \PDO::PARAM_STR;
214 215
 					}
215 216
 					$this->sQuery->bindValue( $value[ 0 ], $value[ 1 ], $type );
@@ -288,8 +289,7 @@  discard block
 block discarded – undo
288 289
 				default:
289 290
 					return self::QUERY_TYPE_OTHER;
290 291
 			}
291
-		}
292
-		else {
292
+		} else {
293 293
 			return self::QUERY_TYPE_OTHER;
294 294
 		}
295 295
 	}
@@ -300,8 +300,9 @@  discard block
 block discarded – undo
300 300
 	 */
301 301
 	public static function isArrayAssoc( array $arr )
302 302
 	{
303
-		if ( array() === $arr )
304
-			return false;
303
+		if ( array() === $arr ) {
304
+					return false;
305
+		}
305 306
 
306 307
 		return array_keys( $arr ) !== range( 0, count( $arr ) - 1 );
307 308
 	}
Please login to merge, or discard this patch.