Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Improve identity view helper factory #33

Closed
bogutskyy opened this issue Jan 30, 2016 · 1 comment
Closed

Improve identity view helper factory #33

bogutskyy opened this issue Jan 30, 2016 · 1 comment

Comments

@bogutskyy
Copy link

I have a few problems with an identity view helper factory.

    public function createService(ServiceLocatorInterface $serviceLocator)
    {
        $services = $serviceLocator->getServiceLocator();
        $helper = new Identity();
        if ($services->has('Zend\Authentication\AuthenticationService')) {
            $helper->setAuthenticationService($services->get('Zend\Authentication\AuthenticationService'));
        }
        return $helper;
    }
  1. First about a retrieving of auth service. Maybe will be better to use Zend\Authentication\AuthenticationServiceInterface instead of Zend\Authentication\AuthenticationService as name of the auth service?
  2. By default HelperPluginManager doesn't contain main service container, and var $services can be null. But it seems in develop branch this factory class already modified.
@gszy
Copy link
Contributor

gszy commented Dec 2, 2017

  1. First about a retrieving of auth service. Maybe will be better to use Zend\Authentication\AuthenticationServiceInterface instead of Zend\Authentication\AuthenticationService as name of the auth service?

See zendframework/zend-mvc-plugin-identity#9

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

No branches or pull requests

3 participants