@@ -80,7 +80,7 @@ |
||
| 80 | 80 | $pdoRowValues = array(); |
| 81 | 81 | |
| 82 | 82 | foreach ( $rowValues as $value ) |
| 83 | - $pdoRowValues[] = $this->queryStructure->bindParam( 'value', $value ); |
|
| 83 | + $pdoRowValues[ ] = $this->queryStructure->bindParam( 'value', $value ); |
|
| 84 | 84 | |
| 85 | 85 | $pdoRowValuesString = '( ' . QueryHelper::implode( $pdoRowValues, ', ' ) . ' )'; |
| 86 | 86 | |
@@ -43,8 +43,8 @@ |
||
| 43 | 43 | $search = array(); |
| 44 | 44 | $replace = array(); |
| 45 | 45 | foreach ( $bindParams as $key => $value ) { |
| 46 | - $search[] = ':' . $key; |
|
| 47 | - $replace[] = DbConnect::getInstance()->quote( $value ); |
|
| 46 | + $search[ ] = ':' . $key; |
|
| 47 | + $replace[ ] = DbConnect::getInstance()->quote( $value ); |
|
| 48 | 48 | } |
| 49 | 49 | $syntax = str_ireplace( $search, $replace, $syntax ); |
| 50 | 50 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * @var array |
| 51 | 51 | */ |
| 52 | - protected $usedInstanceIds = []; |
|
| 52 | + protected $usedInstanceIds = [ ]; |
|
| 53 | 53 | |
| 54 | 54 | /** |
| 55 | 55 | * @var string |
@@ -49,32 +49,32 @@ |
||
| 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 | |
@@ -278,7 +278,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -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 ] ) ); |
@@ -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 | |
@@ -74,19 +74,19 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | private function prepareArrayFields( $fieldsArray = array() ) |
| 76 | 76 | { |
| 77 | - $prepareArray = []; |
|
| 77 | + $prepareArray = [ ]; |
|
| 78 | 78 | |
| 79 | 79 | foreach ( $fieldsArray as $field ) { |
| 80 | 80 | |
| 81 | 81 | switch ( gettype( $field ) ) { |
| 82 | 82 | case QueryStructure::ELEMENT_TYPE_STRING: |
| 83 | - $prepareArray[] = $this->queryStructure->prepare( $field ); |
|
| 83 | + $prepareArray[ ] = $this->queryStructure->prepare( $field ); |
|
| 84 | 84 | break; |
| 85 | 85 | case QueryStructure::ELEMENT_TYPE_ARRAY: |
| 86 | - $prepareArray[] = $this->getFieldByArray( $field ); |
|
| 86 | + $prepareArray[ ] = $this->getFieldByArray( $field ); |
|
| 87 | 87 | break; |
| 88 | 88 | default: |
| 89 | - throw new QueryException('Invalid field description'); |
|
| 89 | + throw new QueryException( 'Invalid field description' ); |
|
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |