Completed
Push — develop ( afe0ec...7c3dfe )
by
unknown
13:30
created

BaseFieldsetFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createService() 11 11 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
 * YAWIK
4
 *
5
 * @filesource
6
 * @license MIT
7
 * @copyright  2013 - 2015 Cross Solution <http://cross-solution.de>
8
 */
9
  
10
/** */
11
namespace Jobs\Factory\Form;
12
13
use Jobs\Form\BaseFieldset;
14
use Zend\ServiceManager\FactoryInterface;
15
use Zend\ServiceManager\ServiceLocatorInterface;
16
17
/**
18
 * Factory for the BaseFieldset (Job Title and Location)
19
 *
20
 * @author Carsten Bleek <[email protected]>
21
 */
22 View Code Duplication
class BaseFieldsetFactory 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...
23
{
24
    /**
25
     * Creates the multiposting select box.
26
     */
27
    public function createService(ServiceLocatorInterface $serviceLocator)
28
    {
29
        /* @var $serviceLocator \Zend\ServiceManager\AbstractPluginManager */
30
31
        $services = $serviceLocator->getServiceLocator();
32
        /* @var \Geo\Options\ModuleOptions $options */
33
        $options = $services->get('Geo/Options');
34
        $fs = new BaseFieldset();
35
        $fs->setLocationEngineType($options->getPlugin());
36
        return $fs;
37
    }
38
}
39