IdentityFactory::createService()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
rs 9.4285
cc 1
eloc 6
nc 1
nop 1
1
<?php
2
namespace ZfcUser\Factory\View\Helper;
3
4
use Zend\Authentication\AuthenticationService;
5
use Zend\ServiceManager\FactoryInterface;
6
use Zend\ServiceManager\ServiceLocatorInterface;
7
use Zend\View\HelperPluginManager;
8
use ZfcUser\View\Helper\ZfcUserIdentity;
9
10
class IdentityFactory implements FactoryInterface
11
{
12
    /**
13
     * {@inheritDoc}
14
     */
15
    public function createService(ServiceLocatorInterface $pluginManager)
16
    {
17
        /* @var $pluginManager HelperPluginManager */
18
        $serviceManager = $pluginManager->getServiceLocator();
19
20
        /* @var $authService AuthenticationService */
21
        $authService = $serviceManager->get('zfcuser_auth_service');
22
23
        $viewHelper = new ZfcUserIdentity;
24
        $viewHelper->setAuthService($authService);
25
26
        return $viewHelper;
27
    }
28
}
29