Skip to content

Commit

Permalink
Refactor for MOODLE41 & PHP 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
luukverhoeven committed Dec 11, 2023
1 parent fbe221f commit 99d5675
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 19 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
with:
disable_grunt: true
disable_phpunit: true
disable_phpcpd: true # Old code we don't going to rewrite everything for now.
disable_phpdoc: true # Old code we don't going to rewrite everything for now.
disable_release : true
release_branches: main
min_php : 7.4
2 changes: 2 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Thanks to Lesterhuis Training & Consultancy for the contribution / updated by Ld
* validation if a class exists and inherits the correct parent class.
* Changelog to separate file
* Move cron to a scheduled task
* phpcpd and phpdocs checks in CI
* Make CSS strict should only effect this plugin!

----------------------------------------------------------------------

Expand Down
2 changes: 0 additions & 2 deletions classes/check/sql_execution.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@

namespace block_configurable_reports\check;

defined('MOODLE_INTERNAL') || die();

use core\check\result;

/**
Expand Down
12 changes: 0 additions & 12 deletions import_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,4 @@ public function definition(): void {
$this->add_action_buttons(false, get_string('importreport', 'block_configurable_reports'));
}

/**
* Server side rules do not work for uploaded files, implement serverside rules here if needed.
*
* @param array $data array of ("fieldname"=>value) of submitted data
* @param array $files array of uploaded files "element_name"=>tmp_file_path
* @return array of "element_name"=>"error_description" if there are errors,
* or an empty array if everything is OK (true allowed for backwards compatibility too).
*/
public function validation($data, $files): array {
return parent::validation($data, $files);
}

}
2 changes: 0 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die();

/**
* Add security check.
*
Expand Down
5 changes: 3 additions & 2 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function cr_unserialize(string $data): array {
$data = preg_replace('/THEN\+%22(.+?)%22/', 'THEN+%27${1}%27', $data);
$data = preg_replace('/%60/', '+++', $data);

// TODO remove unserialize
// TODO remove unserialize.
$data = unserialize($data);

return (array) urldecode_recursive($data);
Expand Down Expand Up @@ -353,7 +353,8 @@ function cr_print_table(object $table, bool $return = false) {
if (!empty($table->summary)) {
$output .= " summary=\"$table->summary\"";
}
$output .= " cellpadding=\"$table->cellpadding\" cellspacing=\"$table->cellspacing\" class=\"$table->class boxalign$table->tablealign\" $tableid>\n";
$output .= " cellpadding=\"$table->cellpadding\" cellspacing=\"$table->cellspacing\"
class=\"$table->class boxalign$table->tablealign\" $tableid>\n";

$countcols = 0;
$isuserid = -1;
Expand Down
2 changes: 1 addition & 1 deletion plugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

// TODO namespace
// TODO namespace.

/**
* Class plugin_base
Expand Down

0 comments on commit 99d5675

Please sign in to comment.