Skip to content

Commit

Permalink
Fix more coding style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Dec 13, 2023
1 parent e98d62a commit 0e6c9ca
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ jobs:
run: moodle-plugin-ci phpcs --max-warnings 0

- name: Moodle PHPDoc Checker
continue-on-error: true # This step will show errors but will not fail.
if: ${{ always() }}
run: moodle-plugin-ci phpdoc

Expand Down
5 changes: 3 additions & 2 deletions category.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* This page shows the list of queries in a category, with edit icons, an add new button
* if you have the report/customsql:definequeries capability
* This page shows the list of queries in a category.
*
* With editing UI, if you have the report/customsql:definequeries capability.
*
* @package report_customsql
* @copyright 2021 The Open University
Expand Down
1 change: 1 addition & 0 deletions classes/local/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public function can_edit(\context $context): bool {
/**
* Check the capability to view the query.
*
* @param \context $context The context to check.
* @return bool Has capability to view or not?
*/
public function can_view(\context $context):bool {
Expand Down
2 changes: 2 additions & 0 deletions classes/output/category_query.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ class category_query implements renderable, templatable {
/** @var query Category object. */
private $category;

/** @var context Context to check the capability. */
private $context;

/** @var moodle_url Return url. */
private $returnurl;

/**
* Create the category renderable object.
*
* @param query $query Query object.
* @param category $category
* @param context $context Context to check the capability.
Expand Down
2 changes: 1 addition & 1 deletion classes/output/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class renderer extends plugin_renderer_base {
* Output the standard action icons (edit, delete and back to list) for a report.
*
* @param stdClass $report the report.
* @param context $context context to use for permission checks.
* @param stdClass $category Category object.
* @param context $context context to use for permission checks.
* @return string HTML for report actions.
*/
public function render_report_actions(stdClass $report, stdClass $category, context $context):string {
Expand Down
2 changes: 0 additions & 2 deletions classes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@
* @copyright 2021 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

class utils {


/**
* Return the current timestamp, or a fixed timestamp specified by an automated test.
*
Expand Down
2 changes: 1 addition & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ function report_customsql_get_ready_to_run_daily_reports($timenow) {
*
* @param object $recipient the message recipient.
* @param object $message the message object.
* @return mixed result of {@link message_send()}.
* @return mixed result of {@see message_send()}.
*/
function report_customsql_send_email_notification($recipient, $message) {

Expand Down
2 changes: 1 addition & 1 deletion templates/form-user-selector-suggestion.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
}}
<span>
<img height="12" src="{{profileimageurlsmall}}" alt="" role="presentation">
<img height="12" src="{{profileimageurlsmall}}" alt="">
<span>{{fullname}}</span>
{{#hasidentity}}
<span><small>{{identity}}</small></span>
Expand Down
5 changes: 5 additions & 0 deletions tests/behat/behat_report_customsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ public function the_custom_sql_report_x_exists(string $reportname, PyStringNode
$this->save_new_report($report);
}

/**
* Helper used by other methods to save a report.
*
* @param array $report the report to save.
*/
protected function save_new_report(array $report) {
global $CFG, $DB;

Expand Down

0 comments on commit 0e6c9ca

Please sign in to comment.