Completed
Push — develop ( 6abf52...f3539b )
by
unknown
14:14
created

TemplateLabelBenefits::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 11

Duplication

Lines 20
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 20
loc 20
rs 9.4286
cc 1
eloc 11
nc 1
nop 0
1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013-2015 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 * @author    [email protected]
9
 */
10
11
namespace Jobs\Form;
12
13
use Core\Form\Form;
14
use Zend\InputFilter\InputFilterProviderInterface;
15
use Jobs\Form\Hydrator\TemplateLabelHydrator;
16
17
/**
18
 * Defines the label of the field "benefits" of a job opening template
19
 *
20
 * @package Jobs\Form
21
 */
22 View Code Duplication
class TemplateLabelBenefits extends Form implements InputFilterProviderInterface
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
    public function getHydrator()
26
    {
27
        if (!$this->hydrator) {
28
            $hydrator = new TemplateLabelHydrator();
29
            $this->setHydrator($hydrator);
30
        }
31
        return $this->hydrator;
32
    }
33
34
    public function init()
35
    {
36
        $this->setName('jobs-form-label-benefits');
37
        $this->setAttributes(
38
            array(
39
            'id' => 'jobs-form-label-benefits',
40
            'data-handle-by' => 'yk-form'
41
            )
42
        );
43
44
        $this->add(
45
            [
46
                'type' => 'Text',
47
                'name' => 'description-label-benefits',
48
                'options' => [
49
                    'use_as_base_fieldset' => true,
50
                ]
51
            ]
52
        );
53
    }
54
55
    public function getInputFilterSpecification()
56
    {
57
        return array(
58
            'description-label-benefits' => array(
59
                'filters' => array(
60
                    array(
61
                        'name' => 'Core\XssFilter'
62
                    )
63
                )
64
            )
65
       );
66
    }
67
}
68