Closed greg0ire closed 1 year ago
The static analysis is broken because of the impossibility to know if we have an array or an object
Dang, I thought we'd be able to leverage https://psalm.dev/docs/annotating_code/type_syntax/conditional_types/ to know what we're dealing with, but I wrongly assumed we'd be able to check feature flag :/
I would expect the ArrayAccess
usage of Token
here without the deprecation messages. Wouldn't that at least keep some of the old code?
Closing in favor of the more sensible #79
Alternative to https://github.com/doctrine/lexer/pull/79 (which I still prefer)
The new class is templatable, which should enable us to specify that the ORM Lexer is an
Lexer<self::T_*>
, and in the future, define an enum called TokenType in the ORM, and switch toLexer<TokenType>
.I tested on the ORM, and with this solution, the PHPUnit test suite no longer breaks.
The static analysis is broken because of the impossibility to know if we have an array or an object, and because I want to reuse the
Token
name.I've considered adding another template param to
AbstractLexer
to fix this, but then it would have to be removed in 2.0, which would make implementing compatibility with 2.0 challenging from the SA point of view.