Completed
Push — develop ( 60c2a6...7c4b2f )
by Carsten
61:42 queued 47:32
created

ApprovalControllerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 0 16 1
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de)
7
 * @license       MIT
8
 */
9
10
namespace Jobs\Factory\Controller;
11
12
use Jobs\Controller\ApprovalController;
13
use Jobs\Repository;
14
use Zend\Mvc\Controller\ControllerManager;
15
use Zend\ServiceManager\FactoryInterface;
16
use Zend\ServiceManager\ServiceLocatorInterface;
17
18
class ApprovalControllerFactory implements FactoryInterface
19
{
20
21
    /**
22
     * Injects all needed services into the IndexController
23
     *
24
     * @param ServiceLocatorInterface $serviceLocator
25
     *
26
     * @return ApprovalController
27
     */
28
    public function createService(ServiceLocatorInterface $serviceLocator)
29
    {
30
        /* @var ControllerManager $serviceLocator */
31
        $service = $serviceLocator->getServiceLocator();
32
33
        $searchForm = $service->get('forms')
34
            ->get('Jobs/ListFilter', [ 'fieldset' => 'Jobs/ListFilterAdminFieldset' ]);
35
36
        /* @var $user \Auth\Entity\User */
37
         $user = $service->get('AuthenticationService')->getUser();
38
39
        /* @var $jobRepository Repository\Job */
40
        $jobRepository = $service->get('repositories')->get('Jobs/Job');
41
42
        return new ApprovalController($jobRepository, $searchForm, $user);
0 ignored issues
show
Unused Code introduced by
The call to ApprovalController::__construct() has too many arguments starting with $user.

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...
43
    }
44
}
45