mudrd8mz / moodle-tool_pluginskel

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

File contents #1

Closed alexandru-elisei closed 3 years ago

alexandru-elisei commented 8 years ago

As the code is right now I don't see any way to access the contents of the files after I call $manager->make(). Under these circumstances I cannot write any PHPUnit tests.

May I propose this function for the manager class:

alexandru-elisei commented 8 years ago

I'm not opposed to having another name for this function. Maybe you think something like get_files() is better (although it might get confused with a getter function for the $files class variable).

mudrd8mz commented 8 years ago

Could the files be in plural as in get_files_content(). For a method get_file_content() I would expect to get the content of a single file.

Otherwise sure, good idea.

alexandru-elisei commented 8 years ago

Done, rebased with the new function name.

Can you merge my branch? I need this function for creating the tests for the other features.

mudrd8mz commented 8 years ago

Looking at the branch, I realised it could be useful to have both: get_file_content($filename) would return the requested file's content (or null). And get_files_content() would return the array as it is now.

alexandru-elisei commented 8 years ago

Do you think a function like get_file_names() might be useful too? Too see which files are generated by the manager?

mudrd8mz commented 8 years ago

yup, why not. just note we should focus on things that are actually needed by the current API consumers.

mudrd8mz commented 3 years ago

Closing for inactivity. Also it seems that most of this now actually exists.