Completed
Pull Request — develop (#229)
by ANTHONIUS
08:26
created

PreferredJobFieldsetFactory   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

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
 * Created by PhpStorm.
4
 * User: toni
5
 * Date: 16/06/16
6
 * Time: 0:36
7
 */
8
9
namespace Cv\Form;
10
11
12
use Zend\ServiceManager\FactoryInterface;
13
use Zend\ServiceManager\ServiceLocatorInterface;
14
15 View Code Duplication
class PreferredJobFieldsetFactory 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...
16
{
17
    /**
18
     * Creates Preferred Job Form
19
     *
20
     * @param ServiceLocatorInterface $serviceLocator
21
     * @return PreferredJobFieldset
22
     */
23
    public function createService(ServiceLocatorInterface $serviceLocator)
24
    {
25
        /* @var $serviceLocator \Zend\ServiceManager\AbstractPluginManager */
26
27
        $services = $serviceLocator->getServiceLocator();
28
        /* @var \Geo\Options\ModuleOptions $options */
29
        $options = $services->get('Geo/Options');
30
        $fs = new PreferredJobFieldset();
31
        $fs->setLocationEngineType($options->getPlugin());
32
        return $fs;
33
    }
34
35
}