Conditions | 1 |
Paths | 1 |
Total Lines | 168 |
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 |
||
86 | protected function configure(): void |
||
87 | { |
||
88 | $this->setName('project:run') |
||
89 | ->setAliases(['run']) |
||
90 | ->setDescription( |
||
91 | 'Parses and transforms the given files to a specified location' |
||
92 | ) |
||
93 | ->setHelp( |
||
94 | <<<HELP |
||
95 | phpDocumentor creates documentation from PHP source files. The simplest way |
||
96 | to use it is: |
||
97 | |||
98 | <info>$ phpdoc run -d [directory to parse] -t [output directory]</info> |
||
99 | |||
100 | This will parse every file ending with .php, .php3 and .phtml in <directory |
||
101 | to parse> and then output a HTML site containing easily readable documentation |
||
102 | in <output directory>. |
||
103 | |||
104 | phpDocumentor will try to look for a phpdoc.dist.xml or phpdoc.xml file in your |
||
105 | current working directory and use that to override the default settings if |
||
106 | present. In the configuration file can you specify the same settings (and |
||
107 | more) as the command line provides. |
||
108 | |||
109 | <comment>Other commands</comment> |
||
110 | In addition to this command phpDocumentor also supports additional commands: |
||
111 | |||
112 | <comment>Available commands:</comment> |
||
113 | <info> help |
||
114 | list |
||
115 | parse |
||
116 | run |
||
117 | transform |
||
118 | <comment>project</comment> |
||
119 | project:parse |
||
120 | project:run |
||
121 | project:transform |
||
122 | <comment>template</comment> |
||
123 | template:generate |
||
124 | template:list |
||
125 | template:package</info> |
||
126 | |||
127 | You can get a more detailed listing of the commands using the <info>list</info> |
||
128 | command and get help by prepending the word <info>help</info> to the command |
||
129 | name. |
||
130 | HELP |
||
131 | ) |
||
132 | ->addOption( |
||
133 | 'target', |
||
134 | 't', |
||
135 | InputOption::VALUE_OPTIONAL, |
||
136 | 'Path where to store the generated output' |
||
137 | ) |
||
138 | ->addOption( |
||
139 | 'cache-folder', |
||
140 | null, |
||
141 | InputOption::VALUE_OPTIONAL, |
||
142 | 'Path where to store the cache files' |
||
143 | ) |
||
144 | ->addOption( |
||
145 | 'filename', |
||
146 | 'f', |
||
147 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
148 | 'Comma-separated list of files to parse. The wildcards ? and * are supported' |
||
149 | ) |
||
150 | ->addOption( |
||
151 | 'directory', |
||
152 | 'd', |
||
153 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
154 | 'Comma-separated list of directories to (recursively) parse' |
||
155 | ) |
||
156 | ->addOption( |
||
157 | 'encoding', |
||
158 | null, |
||
159 | InputOption::VALUE_OPTIONAL, |
||
160 | 'encoding to be used to interpret source files with' |
||
161 | ) |
||
162 | ->addOption( |
||
163 | 'extensions', |
||
164 | null, |
||
165 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
166 | 'Comma-separated list of extensions to parse, defaults to php, php3 and phtml' |
||
167 | ) |
||
168 | ->addOption( |
||
169 | 'ignore', |
||
170 | 'i', |
||
171 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
172 | 'Comma-separated list of file(s) and directories (relative to the source-code directory) that will be ' |
||
173 | . 'ignored. Wildcards * and ? are supported' |
||
174 | ) |
||
175 | ->addOption( |
||
176 | 'ignore-tags', |
||
177 | null, |
||
178 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
179 | 'Comma-separated list of tags that will be ignored, defaults to none. package, subpackage and ignore ' |
||
180 | . 'may not be ignored.' |
||
181 | ) |
||
182 | ->addOption( |
||
183 | 'hidden', |
||
184 | null, |
||
185 | InputOption::VALUE_NONE, |
||
186 | 'Use this option to tell phpDocumentor to parse files and directories that begin with a period (.), ' |
||
187 | . 'by default these are ignored' |
||
188 | ) |
||
189 | ->addOption( |
||
190 | 'ignore-symlinks', |
||
191 | null, |
||
192 | InputOption::VALUE_NONE, |
||
193 | 'Ignore symlinks to other files or directories, default is on' |
||
194 | ) |
||
195 | ->addOption( |
||
196 | 'markers', |
||
197 | 'm', |
||
198 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
199 | 'Comma-separated list of markers/tags to filter' |
||
200 | ) |
||
201 | ->addOption( |
||
202 | 'title', |
||
203 | null, |
||
204 | InputOption::VALUE_OPTIONAL, |
||
205 | 'Sets the title for this project; default is the phpDocumentor logo' |
||
206 | ) |
||
207 | ->addOption( |
||
208 | 'force', |
||
209 | null, |
||
210 | InputOption::VALUE_NONE, |
||
211 | 'Forces a full build of the documentation, does not increment existing documentation' |
||
212 | ) |
||
213 | ->addOption( |
||
214 | 'validate', |
||
215 | null, |
||
216 | InputOption::VALUE_NONE, |
||
217 | 'Validates every processed file using PHP Lint, costs a lot of performance' |
||
218 | ) |
||
219 | ->addOption( |
||
220 | 'visibility', |
||
221 | null, |
||
222 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
223 | 'Specifies the parse visibility that should be displayed in the documentation (comma separated e.g. ' |
||
224 | . '"public,protected")' |
||
225 | ) |
||
226 | ->addOption( |
||
227 | 'defaultpackagename', |
||
228 | null, |
||
229 | InputOption::VALUE_OPTIONAL, |
||
230 | 'Name to use for the default package.', |
||
231 | 'Default' |
||
232 | ) |
||
233 | ->addOption( |
||
234 | 'sourcecode', |
||
235 | null, |
||
236 | InputOption::VALUE_NONE, |
||
237 | 'Whether to include syntax highlighted source code' |
||
238 | ) |
||
239 | ->addOption( |
||
240 | 'template', |
||
241 | null, |
||
242 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
243 | 'Name of the template to use (optional)' |
||
244 | ) |
||
245 | ->addOption( |
||
246 | 'parseprivate', |
||
247 | null, |
||
248 | InputOption::VALUE_NONE, |
||
249 | 'Whether to parse DocBlocks marked with @internal tag' |
||
250 | ); |
||
251 | |||
252 | parent::configure(); |
||
253 | } |
||
254 | |||
316 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.