JobDescriptionTemplate::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 78
Code Lines 41

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 41
dl 0
loc 78
c 0
b 0
f 0
ccs 0
cts 70
cp 0
rs 9.264
cc 1
nc 1
nop 0
crap 2

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright https://yawik.org/COPYRIGHT.php
7
 * @license   MIT
8
 */
9
10
/** Jobs forms */
11
namespace Jobs\Form;
12
13
use Core\Form\Container;
14
15
/**
16
 * Compiles the formular fields of a job opening into a container
17
 *
18
 * @author Mathias Weitz <[email protected]>
19
 */
20
class JobDescriptionTemplate extends Container
21
{
22
23
    /**
24
     * {@inheritDoc}
25
     *
26
     * Adds the standard forms and child containers.
27
     *
28
     * @see \Laminas\Form\Element::init()
29
     */
30
    public function init()
31
    {
32
        $this->setForms(
33
            array(
34
            'descriptionFormDescription' => array(
35
                'type' => 'Jobs/JobDescriptionDescription',
36
                'property' => true,
37
            )
38
            )
39
        );
40
41
        $this->setForms(
42
            array(
43
            'descriptionFormBenefits' => array(
44
                'type' => 'Jobs/JobDescriptionBenefits',
45
                'property' => true,
46
            )
47
            )
48
        );
49
50
        $this->setForms(
51
            [
52
                'templateLabelBenefits' => [
53
                    'type' => 'Jobs/TemplateLabelBenefits',
54
                    'property' => true,
55
                ]
56
            ]
57
        );
58
59
        $this->setForms(
60
            array(
61
            'descriptionFormRequirements' => array(
62
                'type' => 'Jobs/JobDescriptionRequirements',
63
                'property' => true,
64
            )
65
            )
66
        );
67
68
        $this->setForms(
69
            [
70
                'templateLabelRequirements' => [
71
                    'type' => 'Jobs/TemplateLabelRequirements',
72
                    'property' => true,
73
                ]
74
            ]
75
        );
76
77
        $this->setForms(
78
            array(
79
            'descriptionFormQualifications' => array(
80
                'type' => 'Jobs/JobDescriptionQualifications',
81
                'property' => true,
82
            )
83
            )
84
        );
85
86
        $this->setForms(
87
            [
88
                'templateLabelQualifications' => [
89
                    'type' => 'Jobs/TemplateLabelQualifications',
90
                    'property' => true,
91
                ]
92
            ]
93
        );
94
95
        $this->setForms(
96
            array(
97
            'descriptionFormTitle' => array(
98
                'type' => 'Jobs/JobDescriptionTitle',
99
                'property' => true,
100
            )
101
            )
102
        );
103
104
        $this->setForms([
105
                'descriptionFormHtml' => [
106
                    'type' => 'Jobs/JobDescriptionHtml',
107
                    'property' => true,
108
                ],
109
            ]);
110
    }
111
}
112