Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

made it easier to replace the translator service with an implementation of TranslatorInterface #968

Merged
merged 1 commit into from
Jun 30, 2014

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Jun 30, 2014

fixes #961

@@ -72,7 +72,7 @@ public function register(Container $app)
if (isset($app['validator'])) {
$extensions[] = new FormValidatorExtension($app['validator']);

if (isset($app['translator'])) {
if (isset($app['translator']) && method_exists($app['translator'], 'addResource')) {
Copy link

Choose a reason for hiding this comment

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

why not $app instanceof TranslatorInterface?

Copy link
Contributor

Choose a reason for hiding this comment

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

$app is never a translator. It is the Silex application

And addResource is not part of the TranslatorInterface, which is precisely the reason for this check

@davedevelopment
Copy link
Contributor

👍

@fabpot fabpot merged commit d7500db into silexphp:master Jun 30, 2014
fabpot added a commit that referenced this pull request Jun 30, 2014
… implementation of TranslatorInterface (fabpot)

This PR was merged into the 2.0.x-dev branch.

Discussion
----------

made it easier to replace the translator service with an implementation of TranslatorInterface

fixes #961

Commits
-------

d7500db made it easier to replace the translator service with an implementation of TranslatorInterface
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Translator - TranslatorInterface incomplete/Providers assume class not Interface
4 participants