Completed
Pull Request — develop (#462)
by ANTHONIUS
08:03
created

ProfileControllerFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 12 12 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
/**
4
 * YAWIK
5
 *
6
 * @filesource
7
 * @license MIT
8
 * @copyright  2013 - 2017 Cross Solution <http://cross-solution.de>
9
 */
10
11
namespace Organizations\Factory\Controller;
12
use Interop\Container\ContainerInterface;
13
use Organizations\Controller\ProfileController;
14
use Zend\ServiceManager\Factory\FactoryInterface;
15
16
/**
17
 * Create new ProfileController object
18
 *
19
 * @author Anthonius Munthi <[email protected]>
20
 * @package Organizations\Factory\Controller
21
 * @since 0.30
22
 */
23 View Code Duplication
class ProfileControllerFactory 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...
24
{
25
    public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
26
    {
27
        $repo = $container->get('repositories')
28
            ->get('Organizations/Organization')
29
        ;
30
        $jobRepository = $container->get('repositories')
31
            ->get('Jobs/Job')
32
        ;
33
        $translator = $container->get('translator');
34
        $imageFileCacheManager = $container->get('Organizations\ImageFileCache\Manager');
35
        return new ProfileController($repo,$jobRepository,$translator,$imageFileCacheManager);
36
    }
37
}
38