Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[String] Add conflict with symfony/translation-contracts >= 3 #44246

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

Merged
merged 1 commit into from
Nov 24, 2021
Merged

[String] Add conflict with symfony/translation-contracts >= 3 #44246

merged 1 commit into from
Nov 24, 2021

Conversation

Staormin
Copy link
Contributor

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

Got the following issue this morning in symfony 5.4-RC1 with php 8.1:

!!  
!!  Fatal error: Declaration of Symfony\Component\String\Slugger\AsciiSlugger::getLocale() must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::getLocale(): string in /opt/project/vendor/symfony/string/Slugger/AsciiSlugger.php on line 93
!!  Symfony\Component\ErrorHandler\Error\FatalError {#6153
!!    #message: "Compile Error: Declaration of Symfony\Component\String\Slugger\AsciiSlugger::getLocale() must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::getLocale(): string"
!!    #code: 0
!!    #file: "./vendor/symfony/string/Slugger/AsciiSlugger.php"
!!    #line: 93
!!    -error: array:4 [
!!      "type" => 64
!!      "message" => "Declaration of Symfony\Component\String\Slugger\AsciiSlugger::getLocale() must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::getLocale(): string"
!!      "file" => "/opt/project/vendor/symfony/string/Slugger/AsciiSlugger.php"
!!      "line" => 93
!!    ]
!!  }
!!  

This PR fixed the error on my side.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.4 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot carsonbot added this to the 5.4 milestone Nov 24, 2021
@nicolas-grekas
Copy link
Member

Thanks. This change would break BC. Instead, we should not allow translation-contracts v3 in the composer.json file of the component:

    "conflict": {
        "symfony/translation-contracts": ">=3.0"
    },

Can you please update the PR?

@Staormin Staormin changed the title Add missing return type in AsciiSlugger::getLocale() Add conflict with symfony/translation-contracts in symfony/string Nov 24, 2021
@Staormin
Copy link
Contributor Author

Done, sorry for the mistake :D

@nicolas-grekas nicolas-grekas changed the title Add conflict with symfony/translation-contracts in symfony/string [String] Add conflict with symfony/translation-contracts >= 3 Nov 24, 2021
@nicolas-grekas
Copy link
Member

Thank you @Staormin.

@nicolas-grekas nicolas-grekas merged commit d3b714a into symfony:5.4 Nov 24, 2021
@Staormin Staormin deleted the fix/getLocaleType branch November 24, 2021 10:08
@shmshd
Copy link

shmshd commented Nov 24, 2021

@nicolas-grekas Will this fix be released now?

@nicolas-grekas
Copy link
Member

Not before a week. You might want to add the same rule in your composer.json file instead.

fabpot added a commit to twigphp/Twig that referenced this pull request Jul 6, 2024
…PHP 8.0 (xabbuh)

This PR was merged into the 3.x branch.

Discussion
----------

fix the set of installed packages for TwigExtraBundle on PHP 8.0

Prevents symfony/translation-contracts 3 to be installed together with symfony/string 5.4.0-RC1 (see https://github.com/twigphp/Twig/actions/runs/9804849131/job/27073398023#step:8:117). Stable releases of the String component don't suffer from this incompatibility because of symfony/symfony#44246.

Commits
-------

c79c7e7 fix the set of installed packages for TwigExtraBundle on PHP 8.0
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