Conditions | 1 |
Paths | 1 |
Total Lines | 76 |
Code Lines | 48 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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:
If many parameters/temporary variables are present:
1 | <?php |
||
25 | public function init() |
||
26 | { |
||
27 | $this->setName('organization-form'); |
||
28 | |||
29 | $this->setForms( |
||
30 | array( |
||
31 | 'nameForm' => array( |
||
32 | 'type' => 'Organizations/OrganizationsNameForm', |
||
33 | 'property' => true, |
||
34 | 'options' => array( |
||
35 | 'enable_descriptions' => true, |
||
36 | 'description' => /*@translate*/ 'Please enter the name of the hiring organization.', |
||
37 | ), |
||
38 | ), |
||
39 | |||
40 | 'locationForm' => array( |
||
41 | 'type' => 'Organizations/OrganizationsContactForm', |
||
42 | 'property' => 'contact', |
||
43 | 'options' => array( |
||
44 | 'enable_descriptions' => true, |
||
45 | 'description' => /*@translate*/ 'Please enter a contact for the hiring organization.', |
||
46 | ), |
||
47 | ), |
||
48 | |||
49 | 'organizationLogo' => array( |
||
50 | 'type' => 'Organizations/Image', |
||
51 | 'property' => 'images', |
||
52 | 'use_files_array' => true, |
||
53 | |||
54 | 'options' => [ |
||
55 | |||
56 | ] |
||
57 | ), |
||
58 | |||
59 | 'descriptionForm' => array( |
||
60 | 'type' => 'Organizations/OrganizationsDescriptionForm', |
||
61 | 'property' => true, |
||
62 | 'options' => array( |
||
63 | 'enable_descriptions' => true, |
||
64 | 'description' => /*@translate*/ 'Please enter a description for the hiring organization.', |
||
65 | ), |
||
66 | ), |
||
67 | |||
68 | 'employeesManagement' => array( |
||
69 | 'type' => 'Organizations/Employees', |
||
70 | 'property' => true, |
||
71 | 'options' => array( |
||
72 | 'label' => /*@translate*/ 'Employees', |
||
73 | 'enable_descriptions' => true, |
||
74 | 'description' => /*@translate*/ 'Manage your employees and their permissions.', |
||
75 | ), |
||
76 | ), |
||
77 | |||
78 | 'workflowSettings' => array( |
||
79 | 'type' => 'Organizations/WorkflowSettings', |
||
80 | 'property' => 'workflowSettings', |
||
81 | 'options' => array( |
||
82 | 'label' => /*@translate*/ 'Workflow', |
||
83 | 'enable_descriptions' => true, |
||
84 | 'description' => /*@translate*/ 'Define, how notifications about new applications reach your employees', |
||
85 | ), |
||
86 | ), |
||
87 | |||
88 | 'profileSettings' => [ |
||
89 | 'type' => OrganizationsProfileForm::class, |
||
90 | 'property' => true, |
||
91 | 'options' => [ |
||
92 | 'label' => /*@translate*/ 'Profile Setting', |
||
93 | 'enable_descriptions' => true, |
||
94 | 'description' => /*@translate*/ 'Define how profile page should behave' |
||
95 | ] |
||
96 | ] |
||
97 | |||
98 | ) |
||
99 | ); |
||
100 | } |
||
101 | } |
||
102 |