Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Return Type Spacing and Docblock issues #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion classes/asset_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public function __construct(\file_storage $fs = null) {
}

/**
* @return array
* Retrieves a list of assets.
*
* @return array List of asset objects with name, href, and type.
*/
public function get_assets() {
$assets = [];
Expand Down
8 changes: 6 additions & 2 deletions classes/form/assets_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
class assets_form extends \moodleform {

/**
* @return array
* Retrieves options for the file manager element.
*
* @return array Array of options for the file manager, including accepted types and subdir settings.
*/
public static function get_options() {
global $CFG;
Expand All @@ -65,7 +67,9 @@ public static function get_options() {
'subdirs' => true,
];
}

/**
* Defines the form elements.
*/
public function definition() {
$mform = $this->_form;

Expand Down
2 changes: 1 addition & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
*
* @return string
*/
public static function get_reason() : string {
public static function get_reason(): string {
return 'privacy:metadata';
}
}
12 changes: 12 additions & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

/**
* Handles serving of files for the Theme assets tool.
*
* @param stdClass $course The course object.
* @param stdClass $cm Course module.
* @param context $context Context object.
* @param string $filearea The file area.
* @param array $args Additional arguments.
* @param bool $forcedownload Whether or not force download.
* @param array $options Additional options affecting file serving.
* @return bool False if the file not found or context is incorrect.
*/
function tool_themeassets_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, $options = []) {
if (!$context instanceof \context_system) {
return false;
Expand Down
2 changes: 2 additions & 0 deletions tests/options_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
class options_test extends \advanced_testcase {
/**
* Test that overriding accepted types omits wildcard file type usage.
*
* @covers ::test_options_omit_asterisk
*/
public function test_options_omit_asterisk() {
global $CFG;
Expand Down