Skip to content

Commit

Permalink
Merge pull request moodlehq#65 from marinaglancy/wordcount
Browse files Browse the repository at this point in the history
Digits can be used in classes and functions names
  • Loading branch information
stronk7 authored Jan 19, 2021
2 parents 481e245 + 8a13076 commit 35e0305
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion file.php
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ public function get_line_number(local_moodlecheck_file $file, $substring = null)
if ($substring === null) {
return $line0;
} else {
$chunks = preg_split('!' . $substring . '!', $this->originaltoken[1]);
$chunks = preg_split('!' . preg_quote($substring, '!') . '!', $this->originaltoken[1]);
if (count($chunks) > 1) {
$lines = preg_split('/\n/', $chunks[0]);
return $line0 + count($lines) - 1;
Expand Down
2 changes: 1 addition & 1 deletion rules/phpdocs_basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ function local_moodlecheck_phpdoccontentsinlinetag(local_moodlecheck_file $file)
}
break;
case 'see': // Must be 1-word (with some chars allowed - FQSEN only.
if (str_word_count($content, 0, '\()-_:>$') !== 1) {
if (str_word_count($content, 0, '\()-_:>$012345789') !== 1) {
$errors[] = array(
'line' => $phpdocs->get_line_number($file, ' {@' . $curlyinlinetag),
'tag' => '{@' . $curlyinlinetag . '}');
Expand Down

0 comments on commit 35e0305

Please sign in to comment.