Passed
Push — master ( c0e9f0...37b7eb )
by Adrian
02:12
created
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/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/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   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use Qpdb\QueryBuilder\DB\DbService;
10 10
 use Qpdb\QueryBuilder\QueryBuild;
11 11
 
12
-include_once $_SERVER['DOCUMENT_ROOT'] . '/vendor/autoload.php';
12
+include_once $_SERVER[ 'DOCUMENT_ROOT' ] . '/vendor/autoload.php';
13 13
 
14 14
 
15 15
 $query = QueryBuild::select( 'employees' )
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
 $oldInst = DbService::getInstance();
24 24
 
25 25
 
26
-var_dump($oldInst->isMasterOnly());
27
-var_dump($newInst->isMasterOnly());
26
+var_dump( $oldInst->isMasterOnly() );
27
+var_dump( $newInst->isMasterOnly() );
28 28
 
29 29
 
30 30
 echo "<pre>" . print_r( $query->getSyntax(), 1 ) . "</pre>";
Please login to merge, or discard this patch.
src/DB/DbConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
 	 * @param array $dbConfig
98 98
 	 * @return $this
99 99
 	 */
100
-	public function withConfigArray ( array $dbConfig )
100
+	public function withConfigArray( array $dbConfig )
101 101
 	{
102 102
 		$this->dbConfig = $dbConfig;
103 103
 		$this->buildConfig();
Please login to merge, or discard this patch.
src/Traits/SetFields.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 	 */
25 25
 	public function setField( $fieldName, $fieldValue )
26 26
 	{
27
-		$fieldName = $this->queryStructure->prepare($fieldName);
27
+		$fieldName = $this->queryStructure->prepare( $fieldName );
28 28
 		$valuePdoString = $this->queryStructure->bindParam( $fieldName, $fieldValue );
29 29
 		$this->queryStructure->setElement( QueryStructure::SET_FIELDS, "$fieldName = $valuePdoString" );
30 30
 
Please login to merge, or discard this patch.
src/Traits/SelectFields.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,14 +63,14 @@
 block discarded – undo
63 63
 	 */
64 64
 	private function prepareArrayFields( $fieldsArray = array() )
65 65
 	{
66
-		$prepareArray = [];
66
+		$prepareArray = [ ];
67 67
 
68 68
 		foreach ( $fieldsArray as $field ) {
69 69
 			if ( gettype( $field ) !== QueryStructure::ELEMENT_TYPE_STRING )
70 70
 				throw new QueryException( 'Invalid select field type!', QueryException::QUERY_ERROR_SELECT_INVALID_FIELD );
71 71
 
72 72
 			if ( '' !== trim( $field ) )
73
-				$prepareArray[] = $this->queryStructure->prepare( $field );
73
+				$prepareArray[ ] = $this->queryStructure->prepare( $field );
74 74
 		}
75 75
 
76 76
 		return $prepareArray;
Please login to merge, or discard this patch.