Skip to content

Commit

Permalink
Fix. General. Compatibility with php7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
svfcode committed Dec 26, 2023
1 parent 9fb8621 commit 8cf9ae6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Firewall.php
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,8 @@ public static function getFwStats()
{
$fw_stats = new FwStats();
/** @var \Cleantalk\Common\StorageHandler\StorageHandler $storage_handler_class */
$storage_handler_class = new (Mloader::get('StorageHandler'));
$storage_handler_class = Mloader::get('StorageHandler');
$storage_handler_class = new $storage_handler_class;
$stats = $storage_handler_class->getSetting(self::FW_STATS_SETTING_NAME);
if ( $stats !== null ) {
foreach ( $stats as $stat_key => $stat_val ) {
Expand All @@ -432,7 +433,8 @@ public static function saveFwStats(FwStats $fw_stats)
$stats[$stat_key] = $stat_val;
}
/** @var \Cleantalk\Common\StorageHandler\StorageHandler $storage_handler_class */
$storage_handler_class = new (Mloader::get('StorageHandler'));
$storage_handler_class = Mloader::get('StorageHandler');
$storage_handler_class = new $storage_handler_class;
return $storage_handler_class->saveSetting(self::FW_STATS_SETTING_NAME, $stats);
}
}

0 comments on commit 8cf9ae6

Please sign in to comment.