Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$lexer->lookahead array acces is deprecated. #225

Open
laurentmuller opened this issue Jul 5, 2023 · 1 comment
Open

$lexer->lookahead array acces is deprecated. #225

laurentmuller opened this issue Jul 5, 2023 · 1 comment

Comments

@laurentmuller
Copy link
Contributor

We have a deprecation when using the Lexer class with the method lookahead array access:

153x: Accessing Doctrine\Common\Lexer\Token properties via ArrayAccess is deprecated, use the value, type or position property instead (Token.php:104 called by DocParser.php:691, https://github.com/doctrine/lexer/pull/79, package doctrine/lexer) 153x in BackedEnumValueResolverTest::testResolver from Elao\Enum\Tests\Integration\Bridge\Symfony\HttpKernel\Controller\ArgumentResolver

I can not find where the array access is used, but the old code is as following example:

public function parse(Parser $parser): void
{
    // ...
    if (Lexer::T_COMMA === $lexer->lookahead['type']) {
        // ....
    }
}

The public properties must be used instead:

public function parse(Parser $parser): void
{
    // ...
    if (Lexer::T_COMMA === $lexer->lookahead->type) {
        // ....
    }
}
@ogizanagi
Copy link
Member

I don't get how it is related to this package though ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants