Completed
Push — develop ( e3afa3...5fb421 )
by
unknown
07:45
created

UsersControllerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 21
rs 10
c 1
b 0
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 10 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license       MIT
8
 */
9
10
namespace Auth\Factory\Controller;
11
12
use Auth\Controller\UsersController;
13
use Zend\Mvc\Controller\ControllerManager;
14
use Zend\ServiceManager\FactoryInterface;
15
use Zend\ServiceManager\ServiceLocatorInterface;
16
use Auth\Repository\User;
17
18
class UsersControllerFactory implements FactoryInterface
19
{
20
21
    /**
22
     * Create service
23
     *
24
     * @param ServiceLocatorInterface $serviceLocator
25
     *
26
     * @return UsersController
27
     */
28
    public function createService(ServiceLocatorInterface $serviceLocator)
29
    {
30
        /** @var ControllerManager $serviceLocator */
31
        $serviceLocator = $serviceLocator->getServiceLocator();
32
33
        /* @var User $users */
34
        $users = $serviceLocator->get('repositories')->get('Auth/User');
35
36
        return new UsersController($users);
0 ignored issues
show
Unused Code introduced by
The call to UsersController::__construct() has too many arguments starting with $users.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
37
    }
38
}
39