Skip to content

Commit d1580cd

Browse files
committed
Remove noinlinephpdocs check (moodlehq#144)
Replaced with moodlehq/moodle-cs#137
1 parent 48ff9d3 commit d1580cd

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

file.php

-9
Original file line numberDiff line numberDiff line change
@@ -1201,15 +1201,6 @@ public function is_broken_description() {
12011201
return $this->brokentext;
12021202
}
12031203

1204-
/**
1205-
* Returns true if this is an inline phpdoc comment (starting with three slashes)
1206-
*
1207-
* @return bool
1208-
*/
1209-
public function is_inline() {
1210-
return preg_match('|^\s*///|', $this->originaltoken[1]);
1211-
}
1212-
12131204
/**
12141205
* Returns the original token storing this phpdocs
12151206
*

lang/en/local_moodlecheck.php

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737

3838
$string['error_emptynophpfile'] = 'The file is empty or doesn\'t contain PHP code. Skipped.';
3939

40-
$string['rule_noinlinephpdocs'] = 'There are no comments starting with three or more slashes';
41-
$string['error_noinlinephpdocs'] = 'Found comment starting with three or more slashes';
42-
4340
$string['error_phpdocsinvalidinlinetag'] = 'Invalid inline phpdocs tag <b>{$a->tag}</b> found';
4441
$string['rule_phpdocsinvalidinlinetag'] = 'Inline phpdocs tags are valid';
4542

rules/phpdocs_basic.php

-17
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,11 @@
2424

2525
defined('MOODLE_INTERNAL') || die;
2626

27-
local_moodlecheck_registry::add_rule('noinlinephpdocs')->set_callback('local_moodlecheck_noinlinephpdocs');
2827
local_moodlecheck_registry::add_rule('functionarguments')->set_callback('local_moodlecheck_functionarguments');
2928
local_moodlecheck_registry::add_rule('phpdocsinvalidinlinetag')->set_callback('local_moodlecheck_phpdocsinvalidinlinetag');
3029
local_moodlecheck_registry::add_rule('phpdocsuncurlyinlinetag')->set_callback('local_moodlecheck_phpdocsuncurlyinlinetag');
3130
local_moodlecheck_registry::add_rule('phpdoccontentsinlinetag')->set_callback('local_moodlecheck_phpdoccontentsinlinetag');
3231

33-
/**
34-
* Checks that no comment starts with three or more slashes
35-
*
36-
* @param local_moodlecheck_file $file
37-
* @return array of found errors
38-
*/
39-
function local_moodlecheck_noinlinephpdocs(local_moodlecheck_file $file) {
40-
$errors = [];
41-
foreach ($file->get_all_phpdocs() as $phpdocs) {
42-
if ($phpdocs->is_inline()) {
43-
$errors[] = ['line' => $phpdocs->get_line_number($file)];
44-
}
45-
}
46-
return $errors;
47-
}
48-
4932
/**
5033
* Check that all the inline phpdoc tags found are valid
5134
*

0 commit comments

Comments
 (0)