|
24 | 24 |
|
25 | 25 | defined('MOODLE_INTERNAL') || die; |
26 | 26 |
|
27 | | -local_moodlecheck_registry::add_rule('variablesdocumented')->set_callback('local_moodlecheck_variablesdocumented'); |
28 | 27 | local_moodlecheck_registry::add_rule('constsdocumented')->set_callback('local_moodlecheck_constsdocumented'); |
29 | 28 | local_moodlecheck_registry::add_rule('definesdocumented')->set_callback('local_moodlecheck_definesdocumented'); |
30 | 29 | local_moodlecheck_registry::add_rule('noinlinephpdocs')->set_callback('local_moodlecheck_noinlinephpdocs'); |
31 | 30 | local_moodlecheck_registry::add_rule('phpdocsfistline')->set_callback('local_moodlecheck_phpdocsfistline'); |
32 | 31 | local_moodlecheck_registry::add_rule('functiondescription')->set_callback('local_moodlecheck_functiondescription'); |
33 | 32 | local_moodlecheck_registry::add_rule('functionarguments')->set_callback('local_moodlecheck_functionarguments'); |
34 | | -local_moodlecheck_registry::add_rule('variableshasvar')->set_callback('local_moodlecheck_variableshasvar'); |
35 | 33 | local_moodlecheck_registry::add_rule('definedoccorrect')->set_callback('local_moodlecheck_definedoccorrect'); |
36 | 34 | local_moodlecheck_registry::add_rule('phpdocsinvalidinlinetag')->set_callback('local_moodlecheck_phpdocsinvalidinlinetag'); |
37 | 35 | local_moodlecheck_registry::add_rule('phpdocsuncurlyinlinetag')->set_callback('local_moodlecheck_phpdocsuncurlyinlinetag'); |
38 | 36 | local_moodlecheck_registry::add_rule('phpdoccontentsinlinetag')->set_callback('local_moodlecheck_phpdoccontentsinlinetag'); |
39 | 37 |
|
40 | | -/** |
41 | | - * Checks if all variables have phpdocs blocks |
42 | | - * |
43 | | - * @param local_moodlecheck_file $file |
44 | | - * @return array of found errors |
45 | | - */ |
46 | | -function local_moodlecheck_variablesdocumented(local_moodlecheck_file $file) { |
47 | | - $errors = []; |
48 | | - foreach ($file->get_variables() as $variable) { |
49 | | - if ($variable->phpdocs === false) { |
50 | | - $errors[] = ['variable' => $variable->fullname, 'line' => $file->get_line_number($variable->tid)]; |
51 | | - } |
52 | | - } |
53 | | - return $errors; |
54 | | -} |
55 | | - |
56 | 38 | /** |
57 | 39 | * Checks if all constants have phpdocs blocks |
58 | 40 | * |
@@ -340,27 +322,6 @@ function($type) { |
340 | 322 | return implode('|', $types); |
341 | 323 | } |
342 | 324 |
|
343 | | -/** |
344 | | - * Checks that all variables have proper \var token in phpdoc block |
345 | | - * |
346 | | - * @param local_moodlecheck_file $file |
347 | | - * @return array of found errors |
348 | | - */ |
349 | | -function local_moodlecheck_variableshasvar(local_moodlecheck_file $file) { |
350 | | - $errors = []; |
351 | | - foreach ($file->get_variables() as $variable) { |
352 | | - if ($variable->phpdocs !== false) { |
353 | | - $documentedvars = $variable->phpdocs->get_params('var', 2); |
354 | | - if (!count($documentedvars) || $documentedvars[0][0] == 'type') { |
355 | | - $errors[] = [ |
356 | | - 'line' => $variable->phpdocs->get_line_number($file, '@var'), |
357 | | - 'variable' => $variable->fullname, ]; |
358 | | - } |
359 | | - } |
360 | | - } |
361 | | - return $errors; |
362 | | -} |
363 | | - |
364 | 325 | /** |
365 | 326 | * Checks that all define statement have constant name in phpdoc block |
366 | 327 | * |
|
0 commit comments