Skip to content

Conversation

@jroedel
Copy link
Contributor

@jroedel jroedel commented Sep 13, 2017

Warning: I have not ran unit testing on this code!

Please review well, but it fixes issue #89 for me. I have no experience with zend-service-manager 3.0, but it works for me in 2.7.x

Hope this helps

public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$strategy = new UriPathStrategy($container->get('router'));
$strategy = new UriPathStrategy($container->getServiceLocator()->get('router'));
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will not work on ServiceManager v3 instead add this to createService() method and then change

$strategy->setServiceLocator($container);

to:

$strategy->setServiceLocator($container->get(\SlmLocale\Strategy\StrategyPluginManager::class));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @svycka , thanks for the help, but I don't really feel comfortable making the final code change since I don't understand the v3 ServiceManager (I'm also no expert with v2).
This pull request was more just to point out where the problem is and my little workaround.

I'd appreciate it if you could make the change. Thanks for the quick responses!


use Zend\ServiceManager\AbstractPluginManager;
use Zend\ServiceManager\Factory\InvokableFactory;
use SlmLocale\Strategy\Factory\UriPathStrategyFactory;
Copy link
Collaborator

Choose a reason for hiding this comment

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

as you can see cs fixer want this to be above other use statements

@svycka
Copy link
Collaborator

svycka commented Sep 15, 2017

fixed in #91

@svycka svycka closed this Sep 15, 2017
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.

2 participants