Skip to content

Commit 9c45b5a

Browse files
Avoid deprecation with doctrine/lexer 2
1 parent 67f32c1 commit 9c45b5a

27 files changed

+44
-44
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"require": {
1212
"php": "^7.2 || ^8.0",
13-
"doctrine/orm": "^2.7"
13+
"doctrine/orm": "^2.15"
1414
},
1515
"require-dev": {
1616
"doctrine/cache": "^1.11",

src/Query/Mysql/Cast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function parse(Parser $parser): void
4040
$parser->match(Lexer::T_AS);
4141
$parser->match(Lexer::T_IDENTIFIER);
4242

43-
$type = $parser->getLexer()->token['value'];
43+
$type = $parser->getLexer()->token->value;
4444

4545
if ($parser->getLexer()->isNextToken(Lexer::T_OPEN_PARENTHESIS)) {
4646
$parser->match(Lexer::T_OPEN_PARENTHESIS);

src/Query/Mysql/Collate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void
3636

3737
$lexer = $parser->getLexer();
3838

39-
$this->collation = $lexer->token['value'];
39+
$this->collation = $lexer->token->value;
4040

4141
$parser->match(Lexer::T_CLOSE_PARENTHESIS);
4242
}

src/Query/Mysql/ConcatWs.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void
2727

2828
$lexer = $parser->getLexer();
2929

30-
while (count($this->values) < 3 || $lexer->lookahead['type'] == Lexer::T_COMMA) {
30+
while (count($this->values) < 3 || $lexer->lookahead->type == Lexer::T_COMMA) {
3131
$parser->match(Lexer::T_COMMA);
3232
$peek = $lexer->glimpse();
3333

34-
$this->values[] = $peek['value'] == '('
34+
$this->values[] = $peek->value == '('
3535
? $parser->FunctionDeclaration()
3636
: $parser->ArithmeticExpression();
3737
}
3838

39-
while ($lexer->lookahead['type'] == Lexer::T_IDENTIFIER) {
40-
switch (strtolower($lexer->lookahead['value'])) {
39+
while ($lexer->lookahead->type == Lexer::T_IDENTIFIER) {
40+
switch (strtolower($lexer->lookahead->value)) {
4141
case 'notempty':
4242
$parser->match(Lexer::T_IDENTIFIER);
4343
$this->notEmpty = true;

src/Query/Mysql/CountIf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void
2626

2727
$lexer = $parser->getLexer();
2828

29-
while ($lexer->lookahead['type'] == Lexer::T_IDENTIFIER) {
30-
switch (strtolower($lexer->lookahead['value'])) {
29+
while ($lexer->lookahead->type == Lexer::T_IDENTIFIER) {
30+
switch (strtolower($lexer->lookahead->value)) {
3131
case 'inverse':
3232
$parser->match(Lexer::T_IDENTIFIER);
3333
$this->inverse = true;

src/Query/Mysql/Extract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void
2121

2222
$parser->match(Lexer::T_IDENTIFIER);
2323
$lexer = $parser->getLexer();
24-
$this->unit = $lexer->token['value'];
24+
$this->unit = $lexer->token->value;
2525

2626
$parser->match(Lexer::T_IDENTIFIER);
2727
$this->date = $parser->ArithmeticPrimary();

src/Query/Mysql/Field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void
2828
$lexer = $parser->getLexer();
2929

3030
while (count($this->values) < 1 ||
31-
$lexer->lookahead['type'] != Lexer::T_CLOSE_PARENTHESIS) {
31+
$lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) {
3232
$parser->match(Lexer::T_COMMA);
3333
$this->values[] = $parser->ArithmeticPrimary();
3434
}

src/Query/Mysql/FromUnixtime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void
3737
$this->firstExpression = $parser->ArithmeticPrimary();
3838

3939
// parse second parameter if available
40-
if (Lexer::T_COMMA === $lexer->lookahead['type']) {
40+
if (Lexer::T_COMMA === $lexer->lookahead->type) {
4141
$parser->match(Lexer::T_COMMA);
4242
$this->secondExpression = $parser->ArithmeticPrimary();
4343
}

src/Query/Mysql/Greatest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function parse(Parser $parser): void
2828
$lexer = $parser->getLexer();
2929

3030
while (count($this->values) < 1 ||
31-
$lexer->lookahead['type'] != Lexer::T_CLOSE_PARENTHESIS) {
31+
$lexer->lookahead->type != Lexer::T_CLOSE_PARENTHESIS) {
3232
$parser->match(Lexer::T_COMMA);
3333
$this->values[] = $parser->ArithmeticExpression();
3434
}

src/Query/Mysql/GroupConcat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function parse(\Doctrine\ORM\Query\Parser $parser): void
4545
}
4646

4747
if ($lexer->isNextToken(Lexer::T_IDENTIFIER)) {
48-
if (strtolower($lexer->lookahead['value']) !== 'separator') {
48+
if (strtolower($lexer->lookahead->value) !== 'separator') {
4949
$parser->syntaxError('separator');
5050
}
5151
$parser->match(Lexer::T_IDENTIFIER);

0 commit comments

Comments
 (0)