Skip to content

Add missing return type to AsciiSlugger::getLocale() #6

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

Closed
wants to merge 1 commit into from

Conversation

Staormin
Copy link

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
!!    ]
!!  }
!!  

@symfony-bot
Copy link

symfony-bot bot commented Nov 24, 2021

Thanks for your pull request! We love contributions.

However, this repository is what we call a "subtree split": a read-only copy of one directory of the main Symfony repository. It is used by Composer to allow developers to depend on specific Symfony components.

If you want to contribute, you should instead open a pull request on the main repository:

https://github.com/symfony/symfony

Thank you for your contribution!

PS: if you haven't already, please add tests, and beware that bug fixes should be submitted on the lowest maintained branch where they apply.

@@ -90,7 +90,7 @@ public function setLocale($locale)
/**
* {@inheritdoc}
*/
public function getLocale()
public function getLocale(): string
Copy link

@fabrau fabrau Nov 24, 2021

Choose a reason for hiding this comment

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

getLocale cannot return a nullable value ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants