lmscloud-io / mdlcode-docs

5 stars 3 forks source link

Add support for \core\di #3

Closed andrewnicols closed 8 months ago

andrewnicols commented 9 months ago

Example:

\core\di::get(\core\hook\manager::class)->dispatch($hook);
lmscloud-io commented 8 months ago

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?

lmscloud-io commented 8 months ago

dihook