Skip to content

Commit bf4ad3d

Browse files
committed
Apply php-cs-fixer formatting changes
1 parent 61343f6 commit bf4ad3d

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/Components/CaseExpression.php

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class CaseExpression extends Component
5757
public $else_result;
5858

5959
/**
60-
* The alias of this CASE statement
60+
* The alias of this CASE statement.
6161
*
6262
* @var string
6363
*/
@@ -78,8 +78,8 @@ public function __construct()
7878
}
7979

8080
/**
81-
* @param Parser $parser the parser that serves as context
82-
* @param TokensList $list the list of tokens that are being parsed
81+
* @param Parser $parser the parser that serves as context
82+
* @param TokensList $list the list of tokens that are being parsed
8383
* @param array $options parameters for parsing
8484
*
8585
* @return CaseExpression
@@ -209,7 +209,6 @@ public static function parse(Parser $parser, TokensList $list, array $options =
209209
$list->tokens[$list->idx - 1]
210210
);
211211
} else {
212-
213212
// Parse for alias of CASE expression
214213
$asFound = false;
215214
for (; $list->idx < $list->count; ++$list->idx) {
@@ -219,6 +218,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
219218
if ($token->type === Token::TYPE_DELIMITER) {
220219
break;
221220
}
221+
222222
// Skipping whitespaces and comments.
223223
if (($token->type === Token::TYPE_WHITESPACE)
224224
|| ($token->type === Token::TYPE_COMMENT)
@@ -227,9 +227,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =
227227
}
228228

229229
// Handle optional AS keyword before alias
230-
if($token->type === Token::TYPE_KEYWORD
231-
&& $token->keyword === 'AS'){
232-
230+
if ($token->type === Token::TYPE_KEYWORD
231+
&& $token->keyword === 'AS') {
233232
if ($asFound || !empty($ret->alias)) {
234233
$parser->error('Potential duplicate alias of CASE expression.', $token);
235234
break;
@@ -240,8 +239,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =
240239

241240
if ($asFound
242241
&& $token->type === Token::TYPE_KEYWORD
243-
&& ($token->flags & Token::FLAG_KEYWORD_RESERVED || $token->flags & Token::FLAG_KEYWORD_FUNCTION)){
244-
$parser->error('An alias expected after AS but got '.$token->value, $token);
242+
&& ($token->flags & Token::FLAG_KEYWORD_RESERVED || $token->flags & Token::FLAG_KEYWORD_FUNCTION)) {
243+
$parser->error('An alias expected after AS but got ' . $token->value, $token);
245244
$asFound = false;
246245
break;
247246
}
@@ -250,8 +249,7 @@ public static function parse(Parser $parser, TokensList $list, array $options =
250249
|| $token->type === Token::TYPE_STRING
251250
|| ($token->type === Token::TYPE_SYMBOL && !$token->flags & Token::FLAG_SYMBOL_VARIABLE)
252251
|| $token->type === Token::TYPE_NONE
253-
){
254-
252+
) {
255253
// An alias is expected (the keyword `AS` was previously found).
256254
if (!empty($ret->alias)) {
257255
$parser->error('An alias was previously found.', $token);
@@ -269,7 +267,6 @@ public static function parse(Parser $parser, TokensList $list, array $options =
269267
$parser->error('An alias was expected after AS.', $list->tokens[$list->idx - 1]);
270268
}
271269

272-
273270
$ret->expr = self::build($ret);
274271
}
275272

0 commit comments

Comments
 (0)