Skip to content

Commit

Permalink
Code checker changes - 2
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartlamour committed May 10, 2023
1 parent 745f2c1 commit a3de248
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
10 changes: 5 additions & 5 deletions block_alerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function init() {
* Gets the block settings.
*
*/
function specialization() {
public function specialization() {
if (isset($this->config->title)) {
$this->title = $this->title = format_string($this->config->title, true, ['context' => $this->context]);
} else {
Expand Down Expand Up @@ -73,7 +73,7 @@ public function get_content() : stdClass {
return $this->content;
}

/**
/**
* Get the alerts.
*
* @return array alerts items.
Expand All @@ -83,7 +83,7 @@ public function fetch_alerts() : array {
$template = new stdClass();

// Get alerts items.
for ($i = 1 ; $i < 4; $i++) {
for ($i = 1; $i < 4; $i++) {
$alerts = new stdClass();
$alerts->description = get_config('block_alerts', 'description'.$i);
$alerts->title = get_config('block_alerts', 'title'.$i);
Expand All @@ -92,8 +92,8 @@ public function fetch_alerts() : array {
// Check alerts is populated.
if ($alerts->title) {
// Format the date for display.
if($alerts->date) {
$alerts->displaydate = date_format(date_create($alerts->date),"jS M Y");
if ($alerts->date) {
$alerts->displaydate = date_format(date_create($alerts->date), "jS M Y");
}

// Make a temp key value array to sort.
Expand Down
2 changes: 1 addition & 1 deletion classes/admin_setting_date.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function __construct($name, $visiblename, $description, $defaultsetting)
* @param string $query
* @return string HMTL field
*/
public function output_html($data, $query='') : string {
public function output_html($data, $query='') : string {
$default = $this->get_defaultsetting();
return format_admin_setting($this, $this->visiblename,
'<div class="form-text defaultsnext">
Expand Down
2 changes: 2 additions & 0 deletions db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

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

$capabilities = [
'block/alerts:myaddinstance' => [
'captype' => 'write',
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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

$plugin->version = 2023050300; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2019051100; // Requires this Moodle version
$plugin->version = 2023050300; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2019051100; // Requires this Moodle version.
$plugin->component = 'block_alerts'; // Full name of the plugin (used for diagnostics).

0 comments on commit a3de248

Please sign in to comment.