Conditions | 1 |
Paths | 1 |
Total Lines | 144 |
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 |
||
84 | protected function configure(): void |
||
85 | { |
||
86 | $this->addOptions([ |
||
87 | // Global options |
||
88 | 'collate' => null, |
||
89 | 'no-collate' => null, |
||
90 | 'cookie-jar' => null, |
||
91 | 'copies' => null, |
||
92 | 'dpi' => null, |
||
93 | 'extended-help' => null, |
||
94 | 'grayscale' => null, |
||
95 | 'help' => null, |
||
96 | 'htmldoc' => null, |
||
97 | 'ignore-load-errors' => null, // old v0.9 |
||
98 | 'image-dpi' => null, |
||
99 | 'image-quality' => null, |
||
100 | 'license' => null, |
||
101 | 'log-level' => null, |
||
102 | 'lowquality' => true, |
||
103 | 'manpage' => null, |
||
104 | 'margin-bottom' => null, |
||
105 | 'margin-left' => null, |
||
106 | 'margin-right' => null, |
||
107 | 'margin-top' => null, |
||
108 | 'orientation' => null, |
||
109 | 'page-height' => null, |
||
110 | 'page-size' => null, |
||
111 | 'page-width' => null, |
||
112 | 'no-pdf-compression' => null, |
||
113 | 'quiet' => null, |
||
114 | 'read-args-from-stdin' => null, |
||
115 | 'readme' => null, |
||
116 | 'title' => null, |
||
117 | 'use-xserver' => null, |
||
118 | 'version' => null, |
||
119 | // Outline options |
||
120 | 'dump-default-toc-xsl' => null, |
||
121 | 'dump-outline' => null, |
||
122 | 'outline' => null, |
||
123 | 'no-outline' => null, |
||
124 | 'outline-depth' => null, |
||
125 | 'output-format' => null, |
||
126 | // Page options |
||
127 | 'allow' => null, |
||
128 | 'background' => null, |
||
129 | 'no-background' => null, |
||
130 | 'bypass-proxy-for' => null, |
||
131 | 'cache-dir' => null, |
||
132 | 'checkbox-checked-svg' => null, |
||
133 | 'checkbox-svg' => null, |
||
134 | 'cookie' => null, |
||
135 | 'custom-header' => null, |
||
136 | 'custom-header-propagation' => null, |
||
137 | 'no-custom-header-propagation' => null, |
||
138 | 'debug-javascript' => null, |
||
139 | 'no-debug-javascript' => null, |
||
140 | 'default-header' => null, |
||
141 | 'encoding' => null, |
||
142 | 'disable-external-links' => null, |
||
143 | 'enable-external-links' => null, |
||
144 | 'disable-forms' => null, |
||
145 | 'enable-forms' => null, |
||
146 | 'images' => null, |
||
147 | 'no-images' => null, |
||
148 | 'disable-internal-links' => null, |
||
149 | 'enable-internal-links' => null, |
||
150 | 'disable-javascript' => null, |
||
151 | 'enable-javascript' => null, |
||
152 | 'javascript-delay' => null, |
||
153 | 'keep-relative-links' => null, |
||
154 | 'load-error-handling' => null, |
||
155 | 'load-media-error-handling' => null, |
||
156 | 'disable-local-file-access' => null, |
||
157 | 'enable-local-file-access' => null, |
||
158 | 'minimum-font-size' => null, |
||
159 | 'exclude-from-outline' => null, |
||
160 | 'include-in-outline' => null, |
||
161 | 'page-offset' => null, |
||
162 | 'password' => null, |
||
163 | 'disable-plugins' => null, |
||
164 | 'enable-plugins' => null, |
||
165 | 'post' => null, |
||
166 | 'post-file' => null, |
||
167 | 'print-media-type' => null, |
||
168 | 'no-print-media-type' => null, |
||
169 | 'proxy' => null, |
||
170 | 'proxy-hostname-lookup' => null, |
||
171 | 'radiobutton-checked-svg' => null, |
||
172 | 'radiobutton-svg' => null, |
||
173 | 'redirect-delay' => null, // old v0.9 |
||
174 | 'resolve-relative-links' => null, |
||
175 | 'run-script' => null, |
||
176 | 'disable-smart-shrinking' => null, |
||
177 | 'enable-smart-shrinking' => null, |
||
178 | 'ssl-crt-path' => null, |
||
179 | 'ssl-key-password' => null, |
||
180 | 'ssl-key-path' => null, |
||
181 | 'stop-slow-scripts' => null, |
||
182 | 'no-stop-slow-scripts' => null, |
||
183 | 'disable-toc-back-links' => null, |
||
184 | 'enable-toc-back-links' => null, |
||
185 | 'user-style-sheet' => null, |
||
186 | 'username' => null, |
||
187 | 'viewport-size' => null, |
||
188 | 'window-status' => null, |
||
189 | 'zoom' => null, |
||
190 | // Headers and footer options |
||
191 | 'footer-center' => null, |
||
192 | 'footer-font-name' => null, |
||
193 | 'footer-font-size' => null, |
||
194 | 'footer-html' => null, |
||
195 | 'footer-left' => null, |
||
196 | 'footer-line' => null, |
||
197 | 'no-footer-line' => null, |
||
198 | 'footer-right' => null, |
||
199 | 'footer-spacing' => null, |
||
200 | 'header-center' => null, |
||
201 | 'header-font-name' => null, |
||
202 | 'header-font-size' => null, |
||
203 | 'header-html' => null, |
||
204 | 'header-left' => null, |
||
205 | 'header-line' => null, |
||
206 | 'no-header-line' => null, |
||
207 | 'header-right' => null, |
||
208 | 'header-spacing' => null, |
||
209 | 'replace' => null, |
||
210 | // Cover object |
||
211 | 'cover' => null, |
||
212 | // TOC object |
||
213 | 'toc' => null, |
||
214 | // TOC options |
||
215 | 'disable-dotted-lines' => null, |
||
216 | 'toc-depth' => null, // old v0.9 |
||
217 | 'toc-font-name' => null, // old v0.9 |
||
218 | 'toc-l1-font-size' => null, // old v0.9 |
||
219 | 'toc-header-text' => null, |
||
220 | 'toc-header-font-name' => null, // old v0.9 |
||
221 | 'toc-header-font-size' => null, // old v0.9 |
||
222 | 'toc-level-indentation' => null, |
||
223 | 'disable-toc-links' => null, |
||
224 | 'toc-text-size-shrink' => null, |
||
225 | 'xsl-style-sheet' => null, |
||
226 | ]); |
||
227 | } |
||
228 | |||
244 |