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 |
||
28 | public static function getDefaultArray() |
||
29 | { |
||
30 | return [ |
||
31 | 'phpdocumentor' => [ |
||
32 | 'title' => 'my-doc', |
||
33 | 'use-cache' => true, |
||
34 | 'paths' => [ |
||
35 | 'output' => new \phpDocumentor\DomainModel\Dsn('build/docs'), |
||
36 | 'cache' => new \phpDocumentor\DomainModel\Path('/tmp/phpdoc-doc-cache'), |
||
37 | ], |
||
38 | 'versions' => [ |
||
39 | '1.0.0' => [ |
||
40 | 'folder' => '', |
||
41 | 'api' => [ |
||
42 | [ |
||
43 | 'format' => 'php', |
||
44 | 'source' => [ |
||
45 | 'dsn' => new Dsn('file://' . getcwd()), |
||
46 | 'paths' => [ |
||
47 | 0 => 'src', |
||
48 | ], |
||
49 | ], |
||
50 | 'ignore' => [ |
||
51 | 'hidden' => true, |
||
52 | 'symlinks' => true, |
||
53 | 'paths' => [], |
||
54 | ], |
||
55 | 'extensions' => [ |
||
56 | 0 => 'php', |
||
57 | 1 => 'php3', |
||
58 | 2 => 'phtml', |
||
59 | ], |
||
60 | 'visibility' => ['public'], |
||
61 | 'default-package-name' => 'Default', |
||
62 | 'markers' => [ |
||
63 | 0 => 'TODO', |
||
64 | 1 => 'FIXME', |
||
65 | ], |
||
66 | 'encoding' => 'utf8', |
||
67 | 'ignore-tags' => [], |
||
68 | 'validate' => false, |
||
69 | ], |
||
70 | ], |
||
71 | ], |
||
72 | ], |
||
73 | 'templates' => [ |
||
74 | [ |
||
75 | 'name' => 'clean', |
||
76 | ], |
||
77 | ], |
||
78 | ], |
||
79 | ]; |
||
80 | } |
||
81 | |||
144 |