@@ -278,7 +278,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -46,7 +46,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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() |
@@ -97,7 +97,7 @@ |
||
| 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(); |
@@ -24,7 +24,7 @@ |
||
| 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 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $pdoArray = array(); |
| 141 | 141 | foreach ( $value as $item ) { |
| 142 | - $pdoArray[] = $this->queryStructure->bindParam( 'a', $item ); |
|
| 142 | + $pdoArray[ ] = $this->queryStructure->bindParam( 'a', $item ); |
|
| 143 | 143 | } |
| 144 | 144 | $body = [ |
| 145 | 145 | $field, |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | throw new QueryException( 'Invalid where array!', QueryException::QUERY_ERROR_WHERE_INVALID_PARAM_ARRAY ); |
| 217 | 217 | |
| 218 | 218 | if ( count( $param ) == 2 ) |
| 219 | - $param[] = '='; |
|
| 219 | + $param[ ] = '='; |
|
| 220 | 220 | |
| 221 | 221 | $param[ 0 ] = $this->queryStructure->prepare( $param[ 0 ] ); |
| 222 | 222 | $param[ 2 ] = trim( strtoupper( $param[ 2 ] ) ); |
@@ -24,9 +24,9 @@ discard block |
||
| 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 | - $column = $this->queryStructure->prepare($column); |
|
| 29 | + $column = $this->queryStructure->prepare( $column ); |
|
| 30 | 30 | |
| 31 | 31 | if ( !$this->validateColumn( $column, $allowedColumns ) ) |
| 32 | 32 | throw new QueryException( 'Invalid column name in ORDER BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME ); |
@@ -43,9 +43,9 @@ discard block |
||
| 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 | - $column = $this->queryStructure->prepare($column); |
|
| 48 | + $column = $this->queryStructure->prepare( $column ); |
|
| 49 | 49 | |
| 50 | 50 | if ( !$this->validateColumn( $column, $allowedColumns ) ) |
| 51 | 51 | throw new QueryException( 'Invalid column name in ORDER BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME ); |
@@ -24,9 +24,9 @@ discard block |
||
| 24 | 24 | * @return $this |
| 25 | 25 | * @throws QueryException |
| 26 | 26 | */ |
| 27 | - public function groupBy( $column, array $allowedColumns = [] ) |
|
| 27 | + public function groupBy( $column, array $allowedColumns = [ ] ) |
|
| 28 | 28 | { |
| 29 | - $column = $this->queryStructure->prepare($column); |
|
| 29 | + $column = $this->queryStructure->prepare( $column ); |
|
| 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 ); |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * @return $this |
| 44 | 44 | * @throws QueryException |
| 45 | 45 | */ |
| 46 | - public function groupByDesc( $column, array $allowedColumns = [] ) |
|
| 46 | + public function groupByDesc( $column, array $allowedColumns = [ ] ) |
|
| 47 | 47 | { |
| 48 | - $column = $this->queryStructure->prepare($column); |
|
| 48 | + $column = $this->queryStructure->prepare( $column ); |
|
| 49 | 49 | |
| 50 | 50 | if ( !$this->validateColumn( $column, $allowedColumns ) ) |
| 51 | 51 | throw new QueryException( 'Invalid column name in GROUP BY clause', QueryException::QUERY_ERROR_INVALID_COLUMN_NAME ); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | if ( DbConfig::getInstance()->useTablePrefix() ) |
| 53 | 53 | $table = str_ireplace( '::', DbConfig::getInstance()->getTablePrefix(), $table ); |
| 54 | 54 | |
| 55 | - return QueryHelper::addBacktick($table); |
|
| 55 | + return QueryHelper::addBacktick( $table ); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | private function validateTableSubQuery( $table ) |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | if ( !QueryHelper::isInteger( $limit ) ) |
| 32 | 32 | throw new QueryException( 'Invalid Limit value', QueryException::QUERY_ERROR_INVALID_LIMIT ); |
| 33 | 33 | |
| 34 | - $limit = $this->queryStructure->bindParam('lim', (int)$limit); |
|
| 34 | + $limit = $this->queryStructure->bindParam( 'lim', ( int ) $limit ); |
|
| 35 | 35 | |
| 36 | 36 | if ( is_null( $offset ) ) { |
| 37 | 37 | $this->queryStructure->setElement( QueryStructure::LIMIT, $limit ); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | if ( !QueryHelper::isInteger( $offset ) ) |
| 45 | 45 | throw new QueryException( 'Invalid Limit offset', QueryException::QUERY_ERROR_INVALID_LIMIT_OFFSET ); |
| 46 | 46 | |
| 47 | - $offset = $this->queryStructure->bindParam('ofs', (int)$offset); |
|
| 47 | + $offset = $this->queryStructure->bindParam( 'ofs', ( int ) $offset ); |
|
| 48 | 48 | |
| 49 | 49 | $this->queryStructure->setElement( QueryStructure::LIMIT, $offset . ', ' . $limit ); |
| 50 | 50 | |