Skip to content

SF 5.x compatibility #356

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 6 commits into from
Dec 26, 2019
Merged

SF 5.x compatibility #356

merged 6 commits into from
Dec 26, 2019

Conversation

odolbeau
Copy link
Member

@odolbeau odolbeau commented Dec 7, 2019

Linked to #345 which is blocked since a few days.

Contains :

  • Controller refacto: inject all needed services / parameters
  • Deal with different translators interfaces (from component & contracts) where needed
  • Remove usage of kernel.root_dir
  • Deal with both old & new Kernel events.
  • Add some services alias with FQCN (to be completed later in another PR)

TODO before releasing a new major version of this bundle:

@@ -132,7 +132,7 @@ private function convertSourceLocationsToMessages(MessageCatalogue $catalogue, S
}

$key = $sourceLocation->getMessage();
$catalogue->set($key, null, $domain);
Copy link
Member Author

@odolbeau odolbeau Dec 7, 2019

Choose a reason for hiding this comment

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

According to the interface, second parameter must be a string.
Fortunately, the default MessageCatalogue call the add method which is also declared in the interface.

@@ -69,11 +70,19 @@ public function testExecute(): void
$container = $this->getContainer();
$application->add($container->get('php_translator.console.extract'));

// transchoice tag have been definively removed in sf ^5.0
// Remove this condition & views_with_transchoice + associated config once sf ^5.0 is the minimum supported version.
if (\version_compare(Kernel::VERSION, 5.0, '<')) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Might not be the best idea to rely on the Kernel to retrieve the Symfony version but as it's in tests, I think it does the job pretty well.

"phpunit/phpunit": "^8.4"
},
"conflict": {
"symfony/config": "<3.4.31"
Copy link
Member Author

@odolbeau odolbeau Dec 7, 2019

Choose a reason for hiding this comment

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

We need a fix released in symfony/config v3.4.31
I didn't spend time to determine which fix we need but I guess it's this one symfony/config@5d1036e
Otherwise we have failing tests: https://travis-ci.org/php-translation/symfony-bundle/jobs/622045567?utm_medium=notification&utm_source=github_status
Diff between v3.4.30 & v3.4.31 here: symfony/config@v3.4.30...v3.4.31

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Thank you for the PR and for the review.

I'll merge this so people can test master.

@Nyholm
Copy link
Member

Nyholm commented Dec 26, 2019

(I will remember your todos)

@Nyholm Nyholm merged commit e1228da into php-translation:master Dec 26, 2019
@odolbeau odolbeau deleted the sf-5 branch December 26, 2019 10:33
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