Conditions | 1 |
Paths | 1 |
Total Lines | 135 |
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 |
||
23 | public function dataForProcessedConfiguration() |
||
24 | { |
||
25 | return [ |
||
26 | [ |
||
27 | [], |
||
28 | [ |
||
29 | 'pdf' => [ |
||
30 | 'enabled' => true, |
||
31 | 'binary' => 'wkhtmltopdf', |
||
32 | 'options' => [], |
||
33 | 'env' => [], |
||
34 | ], |
||
35 | 'image' => [ |
||
36 | 'enabled' => true, |
||
37 | 'binary' => 'wkhtmltoimage', |
||
38 | 'options' => [], |
||
39 | 'env' => [], |
||
40 | ], |
||
41 | ], |
||
42 | ], |
||
43 | [ |
||
44 | [ |
||
45 | [ |
||
46 | 'pdf' => [ |
||
47 | 'binary' => '/path/to/wkhtmltopdf', |
||
48 | 'options' => ['foo' => 'bar'], |
||
49 | 'env' => [], |
||
50 | ], |
||
51 | 'image' => [ |
||
52 | 'binary' => '/path/to/wkhtmltoimage', |
||
53 | 'options' => ['baz' => 'bat', 'baf' => 'bag'], |
||
54 | 'env' => [], |
||
55 | ], |
||
56 | ], |
||
57 | [ |
||
58 | 'pdf' => [ |
||
59 | 'options' => ['bak' => 'bap'], |
||
60 | 'env' => [], |
||
61 | ], |
||
62 | ], |
||
63 | ], |
||
64 | [ |
||
65 | 'pdf' => [ |
||
66 | 'enabled' => true, |
||
67 | 'binary' => '/path/to/wkhtmltopdf', |
||
68 | 'options' => ['bak' => 'bap'], |
||
69 | 'env' => [], |
||
70 | ], |
||
71 | 'image' => [ |
||
72 | 'enabled' => true, |
||
73 | 'binary' => '/path/to/wkhtmltoimage', |
||
74 | 'options' => ['baz' => 'bat', 'baf' => 'bag'], |
||
75 | 'env' => [], |
||
76 | ], |
||
77 | ], |
||
78 | ], |
||
79 | [ |
||
80 | [ |
||
81 | ['pdf' => ['enabled' => false]], |
||
82 | ], |
||
83 | [ |
||
84 | 'pdf' => [ |
||
85 | 'enabled' => false, |
||
86 | 'binary' => 'wkhtmltopdf', |
||
87 | 'options' => [], |
||
88 | 'env' => [], |
||
89 | ], |
||
90 | 'image' => [ |
||
91 | 'enabled' => true, |
||
92 | 'binary' => 'wkhtmltoimage', |
||
93 | 'options' => [], |
||
94 | 'env' => [], |
||
95 | ], |
||
96 | ], |
||
97 | ], |
||
98 | [ |
||
99 | [ |
||
100 | [ |
||
101 | 'pdf' => [ |
||
102 | 'options' => [ |
||
103 | 'foo-bar' => 'baz', |
||
104 | ], |
||
105 | 'env' => [], |
||
106 | ], |
||
107 | 'image' => [ |
||
108 | 'options' => [ |
||
109 | 'bag-baf' => 'bak', |
||
110 | ], |
||
111 | 'env' => [], |
||
112 | ], |
||
113 | ], |
||
114 | ], |
||
115 | [ |
||
116 | 'pdf' => [ |
||
117 | 'enabled' => true, |
||
118 | 'binary' => 'wkhtmltopdf', |
||
119 | 'options' => [ |
||
120 | 'foo-bar' => 'baz', |
||
121 | ], |
||
122 | 'env' => [], |
||
123 | ], |
||
124 | 'image' => [ |
||
125 | 'enabled' => true, |
||
126 | 'binary' => 'wkhtmltoimage', |
||
127 | 'options' => [ |
||
128 | 'bag-baf' => 'bak', |
||
129 | ], |
||
130 | 'env' => [], |
||
131 | ], |
||
132 | ], |
||
133 | ], |
||
134 | [ |
||
135 | [ |
||
136 | [ |
||
137 | 'process_timeout' => 120, |
||
138 | ], |
||
139 | ], |
||
140 | [ |
||
141 | 'process_timeout' => 120, |
||
142 | 'pdf' => [ |
||
143 | 'enabled' => true, |
||
144 | 'binary' => 'wkhtmltopdf', |
||
145 | 'options' => [], |
||
146 | 'env' => [], |
||
147 | ], |
||
148 | 'image' => [ |
||
149 | 'enabled' => true, |
||
150 | 'binary' => 'wkhtmltoimage', |
||
151 | 'options' => [], |
||
152 | 'env' => [], |
||
153 | ], |
||
154 | ], |
||
155 | ], |
||
156 | ]; |
||
157 | } |
||
158 | } |
||
159 |