Skip to content

Commit

Permalink
Attributes should not be considered a side-effect
Browse files Browse the repository at this point in the history
The use of Attributes should not impact the MOODLE_INTERNAL check.
  • Loading branch information
andrewnicols committed Feb 23, 2024
1 parent 61a380a commit 1ea3d48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions moodle/Sniffs/Files/MoodleInternalSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ protected function get_position_of_relevant_code(File $file, $pointer) {
} else if ($tokens[$pointer]['code'] === T_DECLARE && $tokens[$pointer]['content'] == 'declare') {
// Declare statements must be at start of file.
$pointer = $file->findEndOfStatement($pointer + 1);
} else if ($tokens[$pointer]['code'] === T_ATTRIBUTE) {
// Attribute statements must be at start of file.
$pointer = $tokens[$pointer]['attribute_closer'] + 1;
} else {
$relevantcodefound = true;
}
Expand Down

0 comments on commit 1ea3d48

Please sign in to comment.