diff --git a/classes/dml/outagecache.php b/classes/dml/outagecache.php index 0398cdb..120e8d4 100644 --- a/classes/dml/outagecache.php +++ b/classes/dml/outagecache.php @@ -30,7 +30,7 @@ require_once($CFG->dirroot.'/calendar/lib.php'); * @copyright 2022 Catalyst IT * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class outagecache{ +class outagecache { /** * Private constructor, use static methods instead. */ @@ -40,11 +40,11 @@ class outagecache{ /** * Set active outage cache. * - * @param outage|null $next_outage Next outage to save, null for not setting outage. + * @param outage|null $nextoutage Next outage to save, null for not setting outage. */ - public static function set_active_outage_cache($next_outage = null) { + public static function set_active_outage_cache($nextoutage = null) { $cache = \cache::make('auth_outage', 'cache_active_outage_data'); - $cache->set('cache_active_outage_data', $next_outage); + $cache->set('cache_active_outage_data', $nextoutage); } /** @@ -60,11 +60,11 @@ class outagecache{ /** * Set onging outage cache. * - * @param outage|null $onging_outage Onging outage to save, null for not setting outage. + * @param outage|null $ongingoutage Onging outage to save, null for not setting outage. */ - public static function set_ongoing_outage_cache($onging_outage = null) { + public static function set_ongoing_outage_cache($ongingoutage = null) { $cache = \cache::make('auth_outage', 'cache_ongoing_outage_data'); - $cache->set('cache_ongoing_outage_data', $onging_outage); + $cache->set('cache_ongoing_outage_data', $ongingoutage); } /** @@ -84,4 +84,4 @@ class outagecache{ $cache = \cache::make('auth_outage', 'cache_ongoing_outage_data'); $cache->delete('cache_ongoing_outage_data'); } -} \ No newline at end of file +} diff --git a/classes/dml/outagedb.php b/classes/dml/outagedb.php index 5801cd6..184466b 100644 --- a/classes/dml/outagedb.php +++ b/classes/dml/outagedb.php @@ -218,9 +218,9 @@ class outagedb { throw new coding_exception('$time must be null or a positive int.', $time); } - $outage_cache = outagecache::get_active_outage_cache(); - return $outage_cache && $outage_cache->warntime <= $time && $outage_cache->stoptime >= $time - ? new outage($outage_cache) : null; + $outagecache = outagecache::get_active_outage_cache(); + return $outagecache && $outagecache->warntime <= $time && $outagecache->stoptime >= $time + ? new outage($outagecache) : null; } /** @@ -398,10 +398,10 @@ class outagedb { } // If there is an onging outage in cache, return the outage. - $outage_cache = outagecache::get_ongoing_outage_cache(); - if ($outage_cache) { - return $outage_cache->starttime <= $time && $outage_cache->stoptime >= $time - ? new outage($outage_cache) : null; + $outagecache = outagecache::get_ongoing_outage_cache(); + if ($outagecache) { + return $outagecache->starttime <= $time && $outagecache->stoptime >= $time + ? new outage($outagecache) : null; } $data = $DB->get_records_select( diff --git a/db/caches.php b/db/caches.php index 6a14a7b..636547d 100644 --- a/db/caches.php +++ b/db/caches.php @@ -32,4 +32,4 @@ $definitions = [ 'cache_ongoing_outage_data' => [ 'mode' => cache_store::MODE_APPLICATION, ], -]; \ No newline at end of file +];