moodlehq / moodle-cs

Moodle Coding Style
https://github.com/moodlehq/moodle-cs
GNU General Public License v3.0
18 stars 16 forks source link

Ensure we stop looking for file phpdoc block asap #173

Closed stronk7 closed 4 months ago

stronk7 commented 4 months ago

Previously, we were allowing the getDocTagFromOpenTag() method to advance too much when looking for file phpdoc blocks. Now we stop as soon as any of the stop tokens is found.

Note that this case is very edge one, only reproducible when there are lots of missing class/function phpdoc block, causing some other phpdoc block (type-hinting a variable or whatever) to be picked.

In any case, I think that it's perfectly ok to shortcut the search that way, it can save us some precious iterations.

Fixes #172

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.11%. Comparing base (85e9e0a) to head (13b8e00).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #173 +/- ## ========================================= Coverage 98.11% 98.11% - Complexity 949 950 +1 ========================================= Files 40 40 Lines 2809 2811 +2 ========================================= + Hits 2756 2758 +2 Misses 53 53 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

stronk7 commented 4 months ago

Just amended a few comments and add a new case, via provider, to ensure all cases are covered.