Conditions | 1 |
Paths | 1 |
Total Lines | 53 |
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 |
||
144 | public static function getCustomTargetConfig() |
||
145 | { |
||
146 | return [ |
||
147 | 'phpdocumentor' => [ |
||
148 | 'title' => 'my-doc', |
||
149 | 'use-cache' => true, |
||
150 | 'paths' => [ |
||
151 | 'output' => new \phpDocumentor\DomainModel\Dsn('build/api/docs'), |
||
152 | 'cache' => new \phpDocumentor\DomainModel\Path('/tmp/phpdoc-doc-cache'), |
||
153 | ], |
||
154 | 'versions' => [ |
||
155 | '1.0.0' => [ |
||
156 | 'folder' => '', |
||
157 | 'api' => [ |
||
158 | [ |
||
159 | 'format' => 'php', |
||
160 | 'source' => [ |
||
161 | 'dsn' => new Dsn('file://' . getcwd()), |
||
162 | 'paths' => [ |
||
163 | 0 => 'src', |
||
164 | ], |
||
165 | ], |
||
166 | 'ignore' => [ |
||
167 | 'hidden' => true, |
||
168 | 'symlinks' => true, |
||
169 | 'paths' => [], |
||
170 | ], |
||
171 | 'extensions' => [ |
||
172 | 0 => 'php', |
||
173 | 1 => 'php3', |
||
174 | 2 => 'phtml', |
||
175 | ], |
||
176 | 'visibility' => ['public'], |
||
177 | 'default-package-name' => 'Default', |
||
178 | 'markers' => [ |
||
179 | 0 => 'TODO', |
||
180 | 1 => 'FIXME', |
||
181 | ], |
||
182 | 'encoding' => 'utf8', |
||
183 | 'ignore-tags' => [], |
||
184 | 'validate' => false, |
||
185 | ], |
||
186 | ], |
||
187 | ], |
||
188 | ], |
||
189 | 'templates' => [ |
||
190 | [ |
||
191 | 'name' => 'clean', |
||
192 | ], |
||
193 | ], |
||
194 | ], |
||
195 | ]; |
||
196 | } |
||
197 | } |
||
198 |