Completed
Push — develop ( 975a05...8c983c )
by
unknown
07:04
created

GetOrganizationHandlerFactory::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013-2016 Cross Solution (http://cross-solution.de)
7
 * @author cbleek
8
 * @license   MIT
9
 */
10
11
namespace Organizations\Factory\Controller\Plugin;
12
13
use Interop\Container\ContainerInterface;
14
use Zend\ServiceManager\FactoryInterface;
15
use Core\Repository\RepositoryService;
16
use Organizations\Controller\Plugin\GetOrganizationHandler;
17
18 View Code Duplication
class GetOrganizationHandlerFactory implements FactoryInterface {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
20
    /**
21
     * Create a GetOrganizationHandler controller plugin
22
     *
23
     * @param  ContainerInterface $container
24
     * @param  string             $requestedName
25
     * @param  null|array         $options
26
     *
27
     * @return GetOrganizationHandler
28
     */
29
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
30
    {
31
        /* @var $repositories RepositoryService */
32
        $repositories = $container->get('repositories');
33
        /* @var \Auth\AuthenticationService */
34
        $auth = $container->get('AuthenticationService');
35
        /* @var \Acl\Controller\Plugin\Acl */
36
        $acl = $container->get('ControllerPluginManager')->get('acl');
37
38
        $plugin = new GetOrganizationHandler($repositories, $auth, $acl);
39
        return $plugin;
40
    }
41
42
    public function createService(\Zend\ServiceManager\ServiceLocatorInterface $serviceLocator)
43
    {
44
        /* @var $serviceLocator \Zend\Mvc\Controller\PluginManager */
45
        return $this($serviceLocator->getServiceLocator(), GetOrganizationHandler::class);
46
    }
47
}
48