moodlehq / moodle-local_codechecker

A Moodle local plugin providing a simple web UI to run the MoodleCS coding style checks with PHP_CodeSniffer.
63 stars 72 forks source link

Foreach with three parameters #218

Closed eduardokraus closed 7 months ago

eduardokraus commented 1 year ago

if i have a foreach like this:

/** @var table_header_item $columninfo */
foreach ($this->columninfo as $columninfo)

The plugin validates as OK.

But when it has three parameters it reports error

/** @var table_header_item $columninfo */
foreach ($this->column as $key => $column)

"Inline doc block type-hinting for '$column' does not match next foreach() as variable"

andrewnicols commented 1 year ago

You don’t have a $columninfo variable in the second code block but you do in the doc block. Can you check what happens when you fix this?

eduardokraus commented 7 months ago

Monday, when I tested https://github.com/EduardoKrausME/moodle-mod_certificatebeautiful there was no problem

stronk7 commented 7 months ago

Thanks for the info, @eduardokraus !