Completed
Push — develop ( aedce0...9c12e7 )
by
unknown
07:11
created

CategoriesContainer::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 62
Code Lines 44

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 62
rs 9.4743
c 0
b 0
f 0
cc 1
eloc 44
nc 1
nop 0

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
 * @license MIT
7
 * @copyright  2013 - 2016 Cross Solution <http://cross-solution.de>
8
 */
9
  
10
/** */
11
namespace Jobs\Form;
12
13
use Core\Form\SummaryForm;
14
use Core\Form\WizardContainer;
15
16
/**
17
 * Container for the management of job categories.
18
 * 
19
 * @author Mathias Gelhausen <[email protected]>
20
 * @since 0.29
21
 */
22
class CategoriesContainer extends WizardContainer
23
{
24
25
    public function init()
26
    {
27
        $this->setForms([
28
            'professions' => [
29
                'options' => [
30
                    'label' => 'Professions',
31
                ],
32
                'entity' => 'professions',
33
                'property' => true,
34
                'forms' => [
35
                    'professions' => [
36
                        'type' => 'Core/Tree/Management',
37
                        'property' => true,
38
                        'options' => [
39
                            'enable_descriptions' => true,
40
                            'description' => /*@translate*/ 'Manage the professions you want to assign to jobs.' .
41
                                             /*@translate*/ 'The order of categories can be modified by drag&drop.',
42
                            'display_mode' => SummaryForm::DISPLAY_SUMMARY,
43
                        ],
44
                    ],
45
                ],
46
            ],
47
            'industries' => [
48
                'options' => [
49
                    'label' => 'Industries',
50
                ],
51
                'entity' => 'industries',
52
                'property' => true,
53
                'forms' => [
54
                    'industries' => [
55
                        'type' => 'Core/Tree/Management',
56
                        'property' => true,
57
                        'options' => [
58
                            'enable_descriptions' => true,
59
                            'description' => /*@translate*/ 'Manage the industries you want to assign to jobs.' .
60
                                             /*@translate*/ 'The order of categories can be modified by drag&drop.',
61
                            'display_mode' => SummaryForm::DISPLAY_SUMMARY,
62
                        ],
63
                    ],
64
                ],
65
            ],
66
            'employmentTypes' => [
67
                'options' => [
68
                    'label' => 'Employment Types',
69
                ],
70
                'entity' => 'employmentTypes',
71
                'property' => true,
72
                'forms' => [
73
                    'employmentTypes' => [
74
                        'type' => 'Core/Tree/Management',
75
                        'property' => true,
76
                        'options' => [
77
                            'enable_descriptions' => true,
78
                            'description' => /*@translate*/ 'Manage the employment types you want to assign to jobs.'.
79
                                             /*@translate*/ 'The order of categories can be modified by drag&drop.',
80
                            'display_mode' => SummaryForm::DISPLAY_SUMMARY,
81
                        ],
82
                    ],
83
                ],
84
            ],
85
        ]);
86
    }
87
}
88