Conditions | 1 |
Paths | 1 |
Total Lines | 56 |
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 |
||
87 | public static function getArrayWithMultipleIgnorePaths() |
||
88 | { |
||
89 | return [ |
||
90 | 'phpdocumentor' => [ |
||
91 | 'title' => 'my-doc', |
||
92 | 'use-cache' => true, |
||
93 | 'paths' => [ |
||
94 | 'output' => new \phpDocumentor\DomainModel\Dsn('build/docs'), |
||
95 | 'cache' => new Path('/tmp/phpdoc-doc-cache'), |
||
96 | ], |
||
97 | 'versions' => [ |
||
98 | '1.0.0' => [ |
||
99 | 'folder' => '', |
||
100 | 'api' => [ |
||
101 | [ |
||
102 | 'format' => 'php', |
||
103 | 'source' => [ |
||
104 | 'dsn' => new Dsn('file://' . getcwd()), |
||
105 | 'paths' => [ |
||
106 | 0 => 'src', |
||
107 | ], |
||
108 | ], |
||
109 | 'ignore' => [ |
||
110 | 'hidden' => true, |
||
111 | 'symlinks' => true, |
||
112 | 'paths' => [ |
||
113 | 0 => 'vendor/*', |
||
114 | 1 => 'logs/*', |
||
115 | ], |
||
116 | ], |
||
117 | 'extensions' => [ |
||
118 | 0 => 'php', |
||
119 | 1 => 'php3', |
||
120 | 2 => 'phtml', |
||
121 | ], |
||
122 | 'visibility' => ['public'], |
||
123 | 'default-package-name' => 'Default', |
||
124 | 'markers' => [ |
||
125 | 0 => 'TODO', |
||
126 | 1 => 'FIXME', |
||
127 | ], |
||
128 | 'encoding' => 'utf8', |
||
129 | 'ignore-tags' => [], |
||
130 | 'validate' => false, |
||
131 | ], |
||
132 | ], |
||
133 | ], |
||
134 | ], |
||
135 | 'templates' => [ |
||
136 | [ |
||
137 | 'name' => 'clean', |
||
138 | ], |
||
139 | ], |
||
140 | ], |
||
141 | ]; |
||
142 | } |
||
143 | |||
198 |