Passed
Push — master ( 6b115b...a9306a )
by Adrian
01:37
created
src/Statements/QueryInsertMultiple.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,32 +49,32 @@
 block discarded – undo
49 49
 		/**
50 50
 		 *  Explain
51 51
 		 */
52
-		$syntax[] = $this->getExplainSyntax();
52
+		$syntax[ ] = $this->getExplainSyntax();
53 53
 
54 54
 		/**
55 55
 		 * UPDATE statement
56 56
 		 */
57
-		$syntax[] = $this->statement;
57
+		$syntax[ ] = $this->statement;
58 58
 
59 59
 		/**
60 60
 		 * PRIORITY
61 61
 		 */
62
-		$syntax[] = $this->queryStructure->getElement( QueryStructure::PRIORITY );
62
+		$syntax[ ] = $this->queryStructure->getElement( QueryStructure::PRIORITY );
63 63
 
64 64
 		/**
65 65
 		 * IGNORE clause
66 66
 		 */
67
-		$syntax[] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : '';
67
+		$syntax[ ] = $this->queryStructure->getElement( QueryStructure::IGNORE ) ? 'IGNORE' : '';
68 68
 
69 69
 		/**
70 70
 		 * INTO table
71 71
 		 */
72
-		$syntax[] = 'INTO ' . $this->queryStructure->getElement( QueryStructure::TABLE );
72
+		$syntax[ ] = 'INTO ' . $this->queryStructure->getElement( QueryStructure::TABLE );
73 73
 
74 74
 		/**
75 75
 		 * FIELDS update
76 76
 		 */
77
-		$syntax[] = $this->getInsertMultipleRowsSyntax();
77
+		$syntax[ ] = $this->getInsertMultipleRowsSyntax();
78 78
 
79 79
 		$syntax = implode( ' ', $syntax );
80 80
 
Please login to merge, or discard this patch.
src/Dependencies/QueryStructure.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	/**
61 61
 	 * @var array
62 62
 	 */
63
-	private static $usedInstanceIds = [];
63
+	private static $usedInstanceIds = [ ];
64 64
 
65 65
 	/**
66 66
 	 * @var array
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 		while ( in_array( $instance, self::$usedInstanceIds ) ) {
133 133
 			$instance = QueryHelper::random( 7 );
134 134
 		}
135
-		self::$usedInstanceIds[] = $instance;
135
+		self::$usedInstanceIds[ ] = $instance;
136 136
 
137 137
 		return $instance;
138 138
 	}
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 			return true;
180 180
 
181 181
 		if ( $this->typeEL[ $name ] === self::ELEMENT_TYPE_ARRAY )
182
-			$this->syntaxEL[ $name ][] = $value;
182
+			$this->syntaxEL[ $name ][ ] = $value;
183 183
 		else
184 184
 			$this->syntaxEL[ $name ] = $value;
185 185
 
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 * @param string $search
242 242
 	 * @return string
243 243
 	 */
244
-	public function bindParamsExpression( $expression, array $params = [], $search = '?' )
244
+	public function bindParamsExpression( $expression, array $params = [ ], $search = '?' )
245 245
 	{
246 246
 		if ( !count( $params ) )
247 247
 			return $expression;
@@ -252,12 +252,12 @@  discard block
 block discarded – undo
252 252
 		$params = array_slice( $params, 0, substr_count( $expression, $search ) );
253 253
 
254 254
 		$i = 0;
255
-		$arrayReturn = [];
255
+		$arrayReturn = [ ];
256 256
 		$expressionToArray = explode( $search, $expression );
257 257
 
258 258
 		foreach ( $expressionToArray as $sub ) {
259
-			$arrayReturn[] = $sub;
260
-			$arrayReturn[] = array_key_exists( $i, $params ) ? $this->bindParam( 'exp', $params[ $i ] ) : '';
259
+			$arrayReturn[ ] = $sub;
260
+			$arrayReturn[ ] = array_key_exists( $i, $params ) ? $this->bindParam( 'exp', $params[ $i ] ) : '';
261 261
 			$i++;
262 262
 		}
263 263
 
Please login to merge, or discard this patch.
src/Dependencies/QueryHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
 		foreach ( $brutArray as $value ) {
89 89
 			$value = trim( $value );
90 90
 			if ( '' !== $value )
91
-				$newArray[] = $value;
91
+				$newArray[ ] = $value;
92 92
 		}
93 93
 
94 94
 		return $newArray;
Please login to merge, or discard this patch.
src/Traits/Where.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 * @param string $glue
279 279
 	 * @return $this
280 280
 	 */
281
-	public function whereExpression( $whereString, array $bindParams = [], $glue = 'AND' )
281
+	public function whereExpression( $whereString, array $bindParams = [ ], $glue = 'AND' )
282 282
 	{
283 283
 		$whereString = $this->queryStructure->bindParamsExpression( $whereString, $bindParams );
284 284
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 * @param array $bindParams
291 291
 	 * @return $this
292 292
 	 */
293
-	public function orWhereExpression( $whereString, array $bindParams = [] )
293
+	public function orWhereExpression( $whereString, array $bindParams = [ ] )
294 294
 	{
295 295
 		$whereString = $this->queryStructure->bindParamsExpression( $whereString, $bindParams );
296 296
 
Please login to merge, or discard this patch.
src/Traits/OrderBy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	 * @return $this
25 25
 	 * @throws QueryException
26 26
 	 */
27
-	public function orderBy( $column, array $allowedColumns = [] )
27
+	public function orderBy( $column, array $allowedColumns = [ ] )
28 28
 	{
29 29
 		$column = trim( $column );
30 30
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	 * @return $this
44 44
 	 * @throws QueryException
45 45
 	 */
46
-	public function orderByDesc( $column, array $allowedColumns = [] )
46
+	public function orderByDesc( $column, array $allowedColumns = [ ] )
47 47
 	{
48 48
 		$column = trim( $column );
49 49
 
Please login to merge, or discard this patch.
src/Traits/Having.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	 * @param string $glue
279 279
 	 * @return $this
280 280
 	 */
281
-	public function havingExpression( $whereString, array $bindParams = [], $glue = 'AND' )
281
+	public function havingExpression( $whereString, array $bindParams = [ ], $glue = 'AND' )
282 282
 	{
283 283
 		$whereString = $this->queryStructure->bindParamsExpression( $whereString, $bindParams );
284 284
 
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
 	 * @param array $bindParams
291 291
 	 * @return $this
292 292
 	 */
293
-	public function orHavingExpression( $whereString, array $bindParams = [] )
293
+	public function orHavingExpression( $whereString, array $bindParams = [ ] )
294 294
 	{
295 295
 		$whereString = $this->queryStructure->bindParamsExpression( $whereString, $bindParams );
296 296
 
Please login to merge, or discard this patch.
src/Traits/WhereAndHavingBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 	{
119 119
 		$pdoArray = array();
120 120
 		foreach ( $value as $item ) {
121
-			$pdoArray[] = $this->queryStructure->bindParam( 'a', $item );
121
+			$pdoArray[ ] = $this->queryStructure->bindParam( 'a', $item );
122 122
 		}
123 123
 		$body = [
124 124
 			$field,
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 			throw new QueryException( 'Invalid where array!', QueryException::QUERY_ERROR_WHERE_INVALID_PARAM_ARRAY );
190 190
 
191 191
 		if ( count( $param ) == 2 )
192
-			$param[] = '=';
192
+			$param[ ] = '=';
193 193
 
194 194
 		$param[ 2 ] = trim( strtoupper( $param[ 2 ] ) );
195 195
 		$param[ 2 ] = QueryHelper::clearMultipleSpaces( $param[ 2 ] );
Please login to merge, or discard this patch.
src/DB/DbService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	/**
47 47
 	 * @var array
48 48
 	 */
49
-	private $parameters = [];
49
+	private $parameters = [ ];
50 50
 
51 51
 	/**
52 52
 	 * @var string;
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		$column = null;
126 126
 
127 127
 		foreach ( $Columns as $cells ) {
128
-			$column[] = $cells[ 0 ];
128
+			$column[ ] = $cells[ 0 ];
129 129
 		}
130 130
 
131 131
 		return $column;
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 	 * @param array $parameters
210 210
 	 * @throws DbException
211 211
 	 */
212
-	private function queryInit( $query, $parameters = [] )
212
+	private function queryInit( $query, $parameters = [ ] )
213 213
 	{
214 214
 		$this->lastStatement = self::getQueryStatement( $query );
215 215
 		$this->createPdoConnection();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 			 * Prepare query
221 221
 			 */
222 222
 			$this->sQuery = $this->pdo->prepare( $query );
223
-			$this->prepareParams($parameters);
223
+			$this->prepareParams( $parameters );
224 224
 			$this->pdoBindValues();
225 225
 			$this->sQuery->execute();
226 226
 			if ( DbConfig::getInstance()->isEnableLogQueryDuration() ) {
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 			$this->bindMore( $parameters );
247 247
 		else
248 248
 			foreach ( $parameters as $key => $val )
249
-				$this->parameters[] = array( $key + 1, $val );
249
+				$this->parameters[ ] = array( $key + 1, $val );
250 250
 	}
251 251
 
252 252
 	private function pdoBindValues()
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 	 */
289 289
 	public function bind( $para, $value )
290 290
 	{
291
-		$this->parameters[] = [ ":" . $para, $value ];
291
+		$this->parameters[ ] = [ ":" . $para, $value ];
292 292
 	}
293 293
 
294 294
 	public function CloseConnection()
Please login to merge, or discard this patch.
sample/select.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 $query = QueryBuild::select( 'employees' )
15 15
 	->fields( 'lastName, jobTitle, officeCode' )
16 16
 	->whereEqual( 'jobTitle', "Sales Rep" )
17
-	->whereIn( 'officeCode', [ 2, 3, 4 ] )->orderBy('lastName')->havingEqual('officeCode',2);
17
+	->whereIn( 'officeCode', [ 2, 3, 4 ] )->orderBy( 'lastName' )->havingEqual( 'officeCode', 2 );
18 18
 
19 19
 
20 20
 
Please login to merge, or discard this patch.