Conditions | 1 |
Paths | 1 |
Total Lines | 153 |
Code Lines | 97 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
120 | protected function configure() |
||
121 | { |
||
122 | $this |
||
123 | ->setAliases(array('run')) |
||
124 | ->setDescription( |
||
125 | 'Parses and transforms the given files to a specified location' |
||
126 | ) |
||
127 | ->setHelp( |
||
128 | <<<HELP |
||
129 | phpDocumentor creates documentation from PHP source files. The simplest way |
||
130 | to use it is: |
||
131 | |||
132 | <info>$ phpdoc run -d [directory to parse] -t [output directory]</info> |
||
133 | |||
134 | This will parse every file ending with .php, .php3 and .phtml in <directory |
||
135 | to parse> and then output a HTML site containing easily readable documentation |
||
136 | in <output directory>. |
||
137 | |||
138 | phpDocumentor will try to look for a phpdoc.dist.xml or phpdoc.xml file in your |
||
139 | current working directory and use that to override the default settings if |
||
140 | present. In the configuration file can you specify the same settings (and |
||
141 | more) as the command line provides. |
||
142 | |||
143 | <comment>Other commands</comment> |
||
144 | In addition to this command phpDocumentor also supports additional commands: |
||
145 | |||
146 | <comment>Available commands:</comment> |
||
147 | <info> help |
||
148 | list |
||
149 | parse |
||
150 | run |
||
151 | transform |
||
152 | <comment>project</comment> |
||
153 | project:parse |
||
154 | project:run |
||
155 | project:transform |
||
156 | <comment>template</comment> |
||
157 | template:generate |
||
158 | template:list |
||
159 | template:package</info> |
||
160 | |||
161 | You can get a more detailed listing of the commands using the <info>list</info> |
||
162 | command and get help by prepending the word <info>help</info> to the command |
||
163 | name. |
||
164 | HELP |
||
165 | ) |
||
166 | ->addOption( |
||
167 | 'target', |
||
168 | 't', |
||
169 | InputOption::VALUE_OPTIONAL, |
||
170 | 'Path where to store the generated output' |
||
171 | ) |
||
172 | ->addOption( |
||
173 | 'cache-folder', |
||
174 | null, |
||
175 | InputOption::VALUE_OPTIONAL, |
||
176 | 'Path where to store the cache files' |
||
177 | ) |
||
178 | ->addOption( |
||
179 | 'filename', |
||
180 | 'f', |
||
181 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
182 | 'Comma-separated list of files to parse. The wildcards ? and * are supported' |
||
183 | ) |
||
184 | ->addOption( |
||
185 | 'directory', |
||
186 | 'd', |
||
187 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
188 | 'Comma-separated list of directories to (recursively) parse' |
||
189 | ) |
||
190 | ->addOption( |
||
191 | 'encoding', |
||
192 | null, |
||
193 | InputOption::VALUE_OPTIONAL, |
||
194 | 'encoding to be used to interpret source files with' |
||
195 | ) |
||
196 | ->addOption( |
||
197 | 'extensions', |
||
198 | 'e', |
||
199 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
200 | 'Comma-separated list of extensions to parse, defaults to php, php3 and phtml' |
||
201 | ) |
||
202 | ->addOption( |
||
203 | 'ignore', |
||
204 | 'i', |
||
205 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
206 | 'Comma-separated list of file(s) and directories (relative to the source-code directory) that will be ' |
||
207 | . 'ignored. Wildcards * and ? are supported' |
||
208 | ) |
||
209 | ->addOption( |
||
210 | 'markers', |
||
211 | 'm', |
||
212 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
213 | 'Comma-separated list of markers/tags to filter' |
||
214 | ) |
||
215 | ->addOption( |
||
216 | 'title', |
||
217 | null, |
||
218 | InputOption::VALUE_OPTIONAL, |
||
219 | 'Sets the title for this project; default is the phpDocumentor logo' |
||
220 | ) |
||
221 | ->addOption( |
||
222 | 'force', |
||
223 | null, |
||
224 | InputOption::VALUE_NONE, |
||
225 | 'Forces a full build of the documentation, does not increment existing documentation' |
||
226 | ) |
||
227 | ->addOption( |
||
228 | 'visibility', |
||
229 | null, |
||
230 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
231 | 'Specifies the parse visibility that should be displayed in the documentation (comma separated e.g. ' |
||
232 | . '"public,protected")' |
||
233 | ) |
||
234 | ->addOption( |
||
235 | 'defaultpackagename', |
||
236 | null, |
||
237 | InputOption::VALUE_OPTIONAL, |
||
238 | 'Name to use for the default package.' |
||
239 | ) |
||
240 | ->addOption( |
||
241 | 'sourcecode', |
||
242 | null, |
||
243 | InputOption::VALUE_NONE, |
||
244 | 'Whether to include syntax highlighted source code' |
||
245 | ) |
||
246 | ->addOption( |
||
247 | 'progressbar', |
||
248 | 'p', |
||
249 | InputOption::VALUE_NONE, |
||
250 | 'Whether to show a progress bar; will automatically quiet logging to stdout' |
||
251 | ) |
||
252 | ->addOption( |
||
253 | 'template', |
||
254 | null, |
||
255 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
256 | 'Name of the template to use (optional)' |
||
257 | ) |
||
258 | ->addOption( |
||
259 | 'parseprivate', |
||
260 | null, |
||
261 | InputOption::VALUE_NONE, |
||
262 | 'Whether to parse DocBlocks marked with @internal tag' |
||
263 | ) |
||
264 | ->addArgument( |
||
265 | 'paths', |
||
266 | InputArgument::OPTIONAL | InputArgument::IS_ARRAY, |
||
267 | 'One or more files and folders to process', |
||
268 | array() |
||
269 | ); |
||
270 | |||
271 | parent::configure(); |
||
272 | } |
||
273 | |||
432 |