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

Drop doctrine/lexer 2 #10332

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Drop doctrine/lexer 2 #10332

merged 1 commit into from
Oct 10, 2023

Conversation

greg0ire
Copy link
Member

This allows us to have a totally typed lexer

@derrabus
Copy link
Member

Do we have to drop Lexer 2 for this change or could we do the same with ^2 || ^3?

@greg0ire
Copy link
Member Author

I thought like you and I've backported a lot of it to #10329

* {@inheritdoc}
*/
protected function getType(&$value): TokenType
protected function getType(string &$value): TokenType
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the change that we can't do without altering the version constraint

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, because we didn't add parameter types in v2. That's unfortunate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we did that then we would have to bump to 7.2 in order to drop lexer 1 on ORM 2, so all in all, I think things are better like this. I won't pretend I considered that before though 😅

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the string type for now, so we can keep ^2 || ^3 as constraint? I'm afraid that strictly requiring v3 might block the adoption of ORM 3 in the beginning. We can still drop v2 at a later time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm AFK for 2 weeks, feel free to open another PR with just the ctor type hint, the rest can be type hinting, and we can decide what to do with this PR at the last minute

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favour of ^3. Version 2, as far as I understood, had the job to be a transition for such changes and is supposed to be a short lived release.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but Lexer is not only used in the ORM. And I don't want to block the adoption of ORM 3 because of a single parameter type in a single method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's monitor the install stats of v3 once 2.15 is released, and of v2 starting now, it should give some insight about whether this is going to be a big blocker or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.15 is not even released yet, and the install stats of v3 are already rising, quite close to the install stats of v2: https://packagist.org/packages/doctrine/lexer/stats

I think this is fine to merge, although we might want to do it right before the release of ORM v3, so that we get more data points.

SenseException
SenseException previously approved these changes Dec 22, 2022
@derrabus derrabus mentioned this pull request Dec 29, 2022
@derrabus
Copy link
Member

I've created #10347 which contains all the changes we could agree on. Let's merge #10347 and rebase this PR afterwards. That should give us a very small diff (one parameter type + composer.json). We can leave this PR open until we feel the time is right to drop Lexer 2.

This allows us to have a totally typed lexer
@derrabus derrabus added this to the 3.0.0 milestone Feb 8, 2023
@greg0ire greg0ire merged commit 1fe0910 into doctrine:3.0.x Oct 10, 2023
@greg0ire greg0ire deleted the drop-lexer-2 branch October 10, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants