mudrd8mz / moodle-tool_pluginskel

Generator of Moodle plugins skeletons
https://moodle.org/plugins/tool_pluginskel
Other
51 stars 46 forks source link

Adds manager method verify_events_exist #97

Closed kritisingh1 closed 3 years ago

kritisingh1 commented 4 years ago

Fixes #83 @mudrd8mz Please review!

mudrd8mz commented 4 years ago

Thank you @kritisingh1 for this pull request. I am wondering. Would not it be more useful if the generator actually automatically created them?

mudrd8mz commented 4 years ago

Oh I see now. It is implemented consistently with how the existing verify_capability_exists() and verify_strings_exist() works. Hm. But one could argue that those two cases actually need an input from the developer (to define the cap or define the string text).

But do we really need an input from the developer in case of events? I don't think so. So we could use a name like ensure_event_exists() and implement it accordingly. That is - if these two events are not explicitly declared in the recipe, we will simply add their default implementation.

And in fact, we could apply for the similar principle in the current verify_.... cases too, maybe.

mudrd8mz commented 3 years ago

Thank you @kritisingh1 for the patch. I now merged it to the main branch.