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

UsersControllerFactory::createService()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 10
rs 9.4285
c 1
b 0
f 1
cc 1
eloc 4
nc 1
nop 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