-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
transChoice method is deprecated in Symfony 4.2 #1548
Comments
Hi, symfony/translation recently deprecated a method we use from it. And by default in Laravel any notice even deprecation will stop the process throwing an exception. Symfony let us no choice, all existing version of Carbon are incompatible with symfony/translation 4.2, so we have to publish new version (1.37 and 2.8) using the new translation method. Meanwhile, you can force downgrade symfony/translation: composer require symfony/translation:~4.1 |
Before doing a painful or radical choice, I will discuss it with Symfony staff: symfony/symfony#29607 |
Hi, @robbydooo, regarding new information provided in symfony/symfony#29607 I put this on hold and will not change Carbon until having a way to reproduce it and see if carbon or symfony really do something invalid. |
Hi @kylekatarnls I have been reading this, thanks for looking into this. If i disable the error handling it no longer reports the issue. I will open up a bug with Honeybadger. Apologies for opening this bug on here although the reporting of the error was originating from Carbon so this was pretty well hidden. |
Good news so we have enough time to handle properly this deprecation. Thanks for your investigation. |
Just a question: If I want to upgrade to symfony 5, then Carbon will be incompatible here? |
Symfony 5 is fully supported since the version 2.27.0 thanks to #1937 And |
Hmm, I still do get deprecation messages, although I am using 2.27.0 |
It's because you're not on Symfony 5 |
Thank you! |
I think a better solution would be not to check for the |
You mean a solution compatible from Symfony 3 to 5? If you know such a solution, feel free to submit a PR to show concretely what you mean and please provide some details about pros and cons of the solution. From Carbon point of view, we required required Symfony ^4 (assuming semantic versioning) and start using So it seems Symfony consider deprecation can be added in any minor version, which means you should not worry about deprecation if you don't plan to upgrade to the next major version. Either you consider it as a breaking change, but in this case, the change does not come from Carbon but from Symfony. Note than an other valid option for Carbon could be to not support Symfony 5 or drop completely Symfony 4 to support only Symfony 5 in a next minor or major release. In this case, if you chose to continue to use Symfony 4 you would have been locked on the previous Carbon version and you would also have the deprecation notice despite if would have been a correct way (regarding semver) upgrade. |
@kylekatarnls see #2019 |
Hello,
I encountered an issue with the following code:
Carbon version: 1.36
PHP version: 7.2
Laravel 5.7
I expected to get:
But I actually get:
Error is from /app/vendor/nesbot/carbon/src/Carbon/Carbon.php:4233
Only started happening in the past 48 hours after doing a composer update on my laravel project.
I would do a pull request but I don't know the translation library well enough to know what exactly is happening here.
Let me know if you need any further information.
Thanks!
The text was updated successfully, but these errors were encountered: