|
26 | 26 |
|
27 | 27 | local_moodlecheck_registry::add_rule('definesdocumented')->set_callback('local_moodlecheck_definesdocumented'); |
28 | 28 | local_moodlecheck_registry::add_rule('noinlinephpdocs')->set_callback('local_moodlecheck_noinlinephpdocs'); |
29 | | -local_moodlecheck_registry::add_rule('phpdocsfistline')->set_callback('local_moodlecheck_phpdocsfistline'); |
30 | | -local_moodlecheck_registry::add_rule('functiondescription')->set_callback('local_moodlecheck_functiondescription'); |
31 | 29 | local_moodlecheck_registry::add_rule('functionarguments')->set_callback('local_moodlecheck_functionarguments'); |
32 | 30 | local_moodlecheck_registry::add_rule('definedoccorrect')->set_callback('local_moodlecheck_definedoccorrect'); |
33 | 31 | local_moodlecheck_registry::add_rule('phpdocsinvalidinlinetag')->set_callback('local_moodlecheck_phpdocsinvalidinlinetag'); |
@@ -159,51 +157,6 @@ function local_moodlecheck_phpdoccontentsinlinetag(local_moodlecheck_file $file) |
159 | 157 | return $errors; |
160 | 158 | } |
161 | 159 |
|
162 | | -/** |
163 | | - * Makes sure that file-level phpdocs and all classes have one-line short description |
164 | | - * |
165 | | - * @param local_moodlecheck_file $file |
166 | | - * @return array of found errors |
167 | | - */ |
168 | | -function local_moodlecheck_phpdocsfistline(local_moodlecheck_file $file) { |
169 | | - $errors = []; |
170 | | - |
171 | | - if (($phpdocs = $file->find_file_phpdocs()) && !$file->find_file_phpdocs()->get_shortdescription()) { |
172 | | - $errors[] = [ |
173 | | - 'line' => $phpdocs->get_line_number($file), |
174 | | - 'object' => 'file', |
175 | | - ]; |
176 | | - } |
177 | | - foreach ($file->get_classes() as $class) { |
178 | | - if ($class->phpdocs && !$class->phpdocs->get_shortdescription()) { |
179 | | - $errors[] = [ |
180 | | - 'line' => $class->phpdocs->get_line_number($file), |
181 | | - 'object' => 'class '.$class->name, |
182 | | - ]; |
183 | | - } |
184 | | - } |
185 | | - return $errors; |
186 | | -} |
187 | | - |
188 | | -/** |
189 | | - * Makes sure that all functions have descriptions |
190 | | - * |
191 | | - * @param local_moodlecheck_file $file |
192 | | - * @return array of found errors |
193 | | - */ |
194 | | -function local_moodlecheck_functiondescription(local_moodlecheck_file $file) { |
195 | | - $errors = []; |
196 | | - foreach ($file->get_functions() as $function) { |
197 | | - if ($function->phpdocs !== false && !strlen($function->phpdocs->get_description())) { |
198 | | - $errors[] = [ |
199 | | - 'line' => $function->phpdocs->get_line_number($file), |
200 | | - 'object' => $function->name, |
201 | | - ]; |
202 | | - } |
203 | | - } |
204 | | - return $errors; |
205 | | -} |
206 | | - |
207 | 160 | /** |
208 | 161 | * Checks that all functions have proper arguments in phpdocs |
209 | 162 | * |
|
0 commit comments