isNextAllAnySome uses doctrine/lexel:1 syntax and throws PHP Error #7158

Closed
opened 2026-01-22 15:45:44 +01:00 by admin · 5 comments
Owner

Originally created by @L3tum on GitHub (May 22, 2023).

Bug Report

Q A
BC Break yes?
Version 2.15.1

Summary

Parser.php#585 uses an array-key based access pattern for Lexer Tokens, while all other accesses were changed in 603ab9a185.
This currently results in the following error:

[Error] Cannot use object of type Doctrine\Common\Lexer\Token as array

Current behavior

The object property is accessed via array-access. This blocks basically any attempt to update to any version that contains the commit above.

How to reproduce

Install latest version of this library. Not sure which configuration/context triggers the exact line of code, but it's obviously wrong.

Expected behavior

It works.

Originally created by @L3tum on GitHub (May 22, 2023). ### Bug Report | Q | A |------------ | ------ | BC Break | yes? | Version | 2.15.1 #### Summary [Parser.php#585](https://github.com/doctrine/orm/blob/2.15.x/lib/Doctrine/ORM/Query/Parser.php#L585) uses an array-key based access pattern for Lexer Tokens, while all other accesses were changed in 603ab9a185ff8c7fd93801e528da63fee0e8c797. This currently results in the following error: > [Error] Cannot use object of type Doctrine\Common\Lexer\Token as array #### Current behavior The object property is accessed via array-access. This blocks basically any attempt to update to any version that contains the commit above. #### How to reproduce Install latest version of this library. Not sure which configuration/context triggers the exact line of code, but it's obviously wrong. #### Expected behavior It works.
admin closed this issue 2026-01-22 15:45:45 +01:00
Author
Owner

@greg0ire commented on GitHub (May 22, 2023):

it's obviously wrong.

doctrine/lexer v2 comes with a BC layer based on array-access. That layer is removed in v3. So no, it's not obviously wrong. What version of doctrine/lexer are you using?

@greg0ire commented on GitHub (May 22, 2023): > it's obviously wrong. `doctrine/lexer` v2 comes with a BC layer based on array-access. That layer is removed in v3. So no, it's not obviously wrong. What version of `doctrine/lexer` are you using?
Author
Owner

@L3tum commented on GitHub (May 22, 2023):

Version 2.1.0 is what we've got installed, and we didn't add it manually in our composer.json (so the version was automatically picked)

@L3tum commented on GitHub (May 22, 2023): Version 2.1.0 is what we've got installed, and we didn't add it manually in our composer.json (so the version was automatically picked)
Author
Owner

@greg0ire commented on GitHub (May 22, 2023):

Ok 🤔 … when you open vendor/doctrine/lexer/src/Token.php, does it say implements ArrayAccess? Here is how it should look like, according to what you're telling me: https://github.com/doctrine/lexer/blob/2.1.0/src/Token.php#L19

@greg0ire commented on GitHub (May 22, 2023): Ok :thinking: … when you open `vendor/doctrine/lexer/src/Token.php`, does it say `implements ArrayAccess`? Here is how it should look like, according to what you're telling me: https://github.com/doctrine/lexer/blob/2.1.0/src/Token.php#L19
Author
Owner

@L3tum commented on GitHub (May 22, 2023):

Okay, gotta apologize for the confusion. I checked again and it got the ArrayAccess. Then I downgraded to Lexer v1 and...it still complained about Token.php, despite it literally not existing.
So I checked our phpunit vendor folder (we keep them separate) and voilà, apparently some dependency in there used the Lexer and upgraded to v3, essentially breaking our tests while everything else seemed to work.
It now works correctly....thank you for your time^^

@L3tum commented on GitHub (May 22, 2023): Okay, gotta apologize for the confusion. I checked again and it got the ArrayAccess. Then I downgraded to Lexer v1 and...it still complained about Token.php, despite it literally not existing. So I checked our phpunit vendor folder (we keep them separate) and voilà, apparently some dependency in there used the Lexer and upgraded to v3, essentially breaking our tests while everything else seemed to work. It now works correctly....thank you for your time^^
Author
Owner

@greg0ire commented on GitHub (May 22, 2023):

No worries 🙂

@greg0ire commented on GitHub (May 22, 2023): No worries :slightly_smiling_face:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7158