@@ -61,10 +61,11 @@ discard block |
||
| 61 | 61 | case 'IN': |
| 62 | 62 | case 'NOT IN': |
| 63 | 63 | case '!IN': |
| 64 | - if ( is_a( $value, QuerySelect::class ) ) |
|
| 65 | - return $this->inSelectObject( $field, $value, $operator, $glue, $clauseType ); |
|
| 66 | - elseif ( is_array( $value ) ) |
|
| 67 | - return $this->inArray( $field, $value, $operator, $glue, $clauseType ); |
|
| 64 | + if ( is_a( $value, QuerySelect::class ) ) { |
|
| 65 | + return $this->inSelectObject( $field, $value, $operator, $glue, $clauseType ); |
|
| 66 | + } elseif ( is_array( $value ) ) { |
|
| 67 | + return $this->inArray( $field, $value, $operator, $glue, $clauseType ); |
|
| 68 | + } |
|
| 68 | 69 | break; |
| 69 | 70 | |
| 70 | 71 | default: |
@@ -155,8 +156,9 @@ discard block |
||
| 155 | 156 | */ |
| 156 | 157 | private function getWhereAndHavingSyntax( $clauseType ) |
| 157 | 158 | { |
| 158 | - if ( count( $this->queryStructure->getElement( $clauseType ) ) == 0 ) |
|
| 159 | - return ''; |
|
| 159 | + if ( count( $this->queryStructure->getElement( $clauseType ) ) == 0 ) { |
|
| 160 | + return ''; |
|
| 161 | + } |
|
| 160 | 162 | |
| 161 | 163 | $where = ''; |
| 162 | 164 | $last_type = 'where_start'; |
@@ -185,11 +187,13 @@ discard block |
||
| 185 | 187 | */ |
| 186 | 188 | private function validateWhereParam( $param ) |
| 187 | 189 | { |
| 188 | - if ( count( $param ) < 2 ) |
|
| 189 | - throw new QueryException( 'Invalid where array!', QueryException::QUERY_ERROR_WHERE_INVALID_PARAM_ARRAY ); |
|
| 190 | + if ( count( $param ) < 2 ) { |
|
| 191 | + throw new QueryException( 'Invalid where array!', QueryException::QUERY_ERROR_WHERE_INVALID_PARAM_ARRAY ); |
|
| 192 | + } |
|
| 190 | 193 | |
| 191 | - if ( count( $param ) == 2 ) |
|
| 192 | - $param[] = '='; |
|
| 194 | + if ( count( $param ) == 2 ) { |
|
| 195 | + $param[] = '='; |
|
| 196 | + } |
|
| 193 | 197 | |
| 194 | 198 | $param[ 2 ] = trim( strtoupper( $param[ 2 ] ) ); |
| 195 | 199 | $param[ 2 ] = QueryHelper::clearMultipleSpaces( $param[ 2 ] ); |