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

Fix deprecations from doctrine/lexer #10737

Merged
merged 1 commit into from
Jun 1, 2023

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Jun 1, 2023

Not triggering self-deprecations is easy when you have the right process.

Since we enabled reporting of Doctrine deprecations on the CI of Symfony, we can tell that the processes here are severely broken, as in: E_TOO_MANY_SELF_DEPRECATIONS.

Here is one of them, the community will send more fixes as we make progress on the topic.

Doctrine v3 is going to be a risky release if the processes are not fixed before.

This feels so Symfony-2.7 :(

Sorry for the bad-mood message but it's not like I didn't extensively explain that this was about to happen when doctrine/deprecations was introduced...

With the right processes, deprecations would have been MUCH cheaper to deal with for everybody: maintainers and users.

@greg0ire greg0ire mentioned this pull request Jun 1, 2023
@greg0ire
Copy link
Member

greg0ire commented Jun 1, 2023

It's not the same package, so technically, those are not self deprecations :P
Thanks for fixing this though, I'll try to think about improving the processes, there is probably room for improvement indeed.

@greg0ire greg0ire added this to the 2.15.2 milestone Jun 1, 2023
@greg0ire greg0ire merged commit bf449be into doctrine:2.15.x Jun 1, 2023
@nicolas-grekas nicolas-grekas deleted the lexer-deprec branch June 1, 2023 09:35
@greg0ire
Copy link
Member

greg0ire commented Jun 1, 2023

Thanks @nicolas-grekas ! I'll do a release right now since we got 2 PRs for this already.

@nicolas-grekas
Copy link
Member Author

Thanks for merging.
You can wait a bit if you want, at least until we fixed other deprecations in Symfony.
(we don't need a release for the CI of Symfony)

@greg0ire
Copy link
Member

greg0ire commented Jun 1, 2023

Well… that ship has sailed already. No harm done IMO, but I will wait for our signal next time.

@MalikOvaiz
Copy link

Hi,

I am using version 2.16 of doctrine/orm and I still get indirect deprecation notices.

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, doctrine/lexer#79, package doctrine/lexer)

Is this not supposed to be fixed after this merge request?

@greg0ire
Copy link
Member

greg0ire commented Sep 15, 2023

@MalikOvaiz you're reporting this to the wrong package: DocParser.php is part of doctrine/annotations.

@pfpro
Copy link

pfpro commented Dec 5, 2023

@greg0ire
and what is your opinion about this deprecation: ?

User Deprecated: Accessing Doctrine\Common\Lexer\Token properties via ArrayAccess is deprecated, use the value, type or position property instead (Token.php:104 called by TimestampDiff.php:25, doctrine/lexer#79, package doctrine/lexer)

(doctrine 2.17.1)

@greg0ire
Copy link
Member

greg0ire commented Dec 6, 2023

@pfpro no opinion, I do not know that TimestampDiff.php file you are mentioning.

@pfpro
Copy link

pfpro commented Dec 6, 2023

Unfortunately, neither do I :)
Thanks for your opinion anyway

@greg0ire
Copy link
Member

greg0ire commented Dec 6, 2023

Yeah but you, on the other hand, have that file on your disk, presumably so maybe you could search for it, you know?

@pfpro
Copy link

pfpro commented Dec 6, 2023

good point, i'll keep on researching

its the TimestampDiff.php from beberlei/doctrineextensions

@greg0ire
Copy link
Member

greg0ire commented Dec 8, 2023

Then you know where to report this now.

@pfpro
Copy link

pfpro commented Dec 8, 2023

Not really ...

Issues are disabled on this repository, if a custom DQL function that you want isn't provided, or does not support the arguments you want to pass, pull requests are open and we would love to have your contributions.

This is the full log:

{"exception":"[object] (ErrorException(code: 0): User Deprecated: Accessing Doctrine\\Common\\Lexer\\Token properties via ArrayAccess is deprecated, use the value, type or position property instead (Token.php:104 called by TimestampDiff.php:25, https://github.com/doctrine/lexer/pull/79, package doctrine/lexer) at /usr/www/.../vendor/doctrine/deprecations/lib/Doctrine/Deprecations/Deprecation.php:210)"} []

@greg0ire
Copy link
Member

greg0ire commented Dec 8, 2023

Okay, so send a pull request to apply the advice in the error message to TimestampDiff line 25… it must be using array access instead of object access.

@pfpro
Copy link

pfpro commented Dec 9, 2023

How about you take care of it in this case? You seem to know exactly how to solve this mission. Shout outs to Paris!

@greg0ire
Copy link
Member

greg0ire commented Dec 9, 2023

I'm away from keyboard, can't do it, sorry!

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.

4 participants