Completed
Pull Request — develop (#236)
by ANTHONIUS
09:12
created

SearchForm   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 47.22 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 17 17 1
A setViewPartial() 0 4 1
A getViewPartial() 0 4 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
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license       MIT
8
 */
9
10
namespace Cv\Form;
11
12
use Zend\Form\Form;
13
use Core\Form\ViewPartialProviderInterface;
14
15
class SearchForm extends Form implements ViewPartialProviderInterface
16
{
17
    protected $fieldset = 'Cv/SearchFormFieldset';
18
19
    protected $viewPartial = 'cv/form/search.phtml';
20
21 View Code Duplication
    public function init()
0 ignored issues
show
Duplication introduced by
This method 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...
22
    {
23
        $this->setName('cv-list-filter');
24
        $this->setAttributes([
25
            'id' => 'cv-list-filter',
26
            'data-handle-by' => 'native',
27
        ]);
28
29
        $this->add([
30
            'type' => $this->fieldset,
31
            'options' => [
32
                'use_as_base_fieldset' => false
33
            ]
34
        ]);
35
36
        
37
    }
38
39
    public function setViewPartial($partial)
40
    {
41
        $this->viewPartial = $partial;
42
    }
43
44
    public function getViewPartial()
45
    {
46
        return $this->viewPartial;
47
    }
48
49
50
}