Conditions | 1 |
Paths | 1 |
Total Lines | 120 |
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 |
||
46 | protected function configure(): void |
||
47 | { |
||
48 | $this->setAliases(['parse']) |
||
49 | ->setDescription('Creates a structure file from your source code') |
||
50 | ->setHelp(<<<HELP |
||
51 | The parse task uses the source files defined either by -f or -d options and |
||
52 | generates cache files at the target location. |
||
53 | HELP |
||
54 | ) |
||
55 | ->addOption( |
||
56 | 'filename', |
||
57 | 'f', |
||
58 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
59 | 'Comma-separated list of files to parse. The wildcards ? and * are supported' |
||
60 | ) |
||
61 | ->addOption( |
||
62 | 'directory', |
||
63 | 'd', |
||
64 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
65 | 'Comma-separated list of directories to (recursively) parse' |
||
66 | ) |
||
67 | ->addOption( |
||
68 | 'target', |
||
69 | 't', |
||
70 | InputOption::VALUE_OPTIONAL, |
||
71 | 'Path where to store the cache (optional)' |
||
72 | ) |
||
73 | ->addOption( |
||
74 | 'encoding', |
||
75 | null, |
||
76 | InputOption::VALUE_OPTIONAL, |
||
77 | 'Encoding to be used to interpret source files with' |
||
78 | ) |
||
79 | ->addOption( |
||
80 | 'extensions', |
||
81 | null, |
||
82 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
83 | 'Comma-separated list of extensions to parse, defaults to php, php3 and phtml' |
||
84 | ) |
||
85 | ->addOption( |
||
86 | 'ignore', |
||
87 | 'i', |
||
88 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
89 | 'Comma-separated list of file(s) and directories that will be ignored. Wildcards * and ? ' |
||
90 | . 'are supported' |
||
91 | ) |
||
92 | ->addOption( |
||
93 | 'ignore-tags', |
||
94 | null, |
||
95 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
96 | 'Comma-separated list of tags that will be ignored, defaults to none. package, subpackage ' |
||
97 | . 'and ignore may not be ignored.' |
||
98 | ) |
||
99 | ->addOption( |
||
100 | 'hidden', |
||
101 | null, |
||
102 | InputOption::VALUE_NONE, |
||
103 | 'Use this option to tell phpDocumentor to parse files and directories that begin with a ' |
||
104 | . 'period (.), by default these are ignored' |
||
105 | ) |
||
106 | ->addOption( |
||
107 | 'ignore-symlinks', |
||
108 | null, |
||
109 | InputOption::VALUE_NONE, |
||
110 | 'Ignore symlinks to other files or directories, default is on' |
||
111 | ) |
||
112 | ->addOption( |
||
113 | 'markers', |
||
114 | 'm', |
||
115 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
116 | 'Comma-separated list of markers/tags to filter', |
||
117 | ['TODO', 'FIXME'] |
||
118 | ) |
||
119 | ->addOption( |
||
120 | 'title', |
||
121 | null, |
||
122 | InputOption::VALUE_OPTIONAL, |
||
123 | 'Sets the title for this project; default is the phpDocumentor logo' |
||
124 | ) |
||
125 | ->addOption( |
||
126 | 'force', |
||
127 | null, |
||
128 | InputOption::VALUE_NONE, |
||
129 | 'Forces a full build of the documentation, does not increment existing documentation' |
||
130 | ) |
||
131 | ->addOption( |
||
132 | 'validate', |
||
133 | null, |
||
134 | InputOption::VALUE_NONE, |
||
135 | 'Validates every processed file using PHP Lint, costs a lot of performance' |
||
136 | ) |
||
137 | ->addOption( |
||
138 | 'visibility', |
||
139 | null, |
||
140 | InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, |
||
141 | 'Specifies the parse visibility that should be displayed in the documentation (comma ' |
||
142 | . 'separated e.g. "public,protected")' |
||
143 | ) |
||
144 | ->addOption( |
||
145 | 'sourcecode', |
||
146 | null, |
||
147 | InputOption::VALUE_NONE, |
||
148 | 'Whether to include syntax highlighted source code' |
||
149 | ) |
||
150 | ->addOption( |
||
151 | 'parseprivate', |
||
152 | null, |
||
153 | InputOption::VALUE_NONE, |
||
154 | 'Whether to parse DocBlocks marked with @internal tag' |
||
155 | ) |
||
156 | ->addOption( |
||
157 | 'defaultpackagename', |
||
158 | null, |
||
159 | InputOption::VALUE_OPTIONAL, |
||
160 | 'Name to use for the default package.', |
||
161 | 'Default' |
||
162 | ); |
||
163 | |||
164 | parent::configure(); |
||
165 | } |
||
166 | |||
178 |