lmscloud-io/mdlcode-docs

Add support for \core\di

Closed this issue · 2 comments

Example:

\core\di::get(\core\hook\manager::class)->dispatch($hook);

Hi Andrew, v 1.0.26 adds support for the expressions like:

\core\di::get(\core\hook\manager::class)->dispatch($hook); // detects hook emitter
\core\di::get(moodle_database::class)->get_records('course'); // detects reference to the table 'course'
\core\di::get(core_string_manager::class)->get_string('yes'); // detects reference to the string 'yes'

adding '.phpstorm.meta.php' to the moodle root like you suggested, allows to work with di instances as if they were normal classes, there is no need to additionally support it in mdlcode. Maybe we should add it to the codebase in 4.4?