address Codacy issues

This commit is contained in:
El RIDO 2021-06-13 10:53:01 +02:00
parent 93135e0abf
commit 1f2dddd9d8
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
4 changed files with 15 additions and 24 deletions

View file

@ -35,7 +35,7 @@ abstract class AbstractData
* @static
* @var array
*/
protected static $_traffic_limiter_cache = array();
protected static $_last_cache = array();
/**
* Enforce singleton, disable constructor
@ -150,9 +150,9 @@ abstract class AbstractData
public function purgeValues($namespace, $time)
{
if ($namespace === 'traffic_limiter') {
foreach (self::$_traffic_limiter_cache as $key => $last_access) {
if ($last_access <= $time) {
unset(self::$_traffic_limiter_cache[$key]);
foreach (self::$_last_cache as $key => $last_submission) {
if ($last_submission <= $time) {
unset(self::$_last_cache[$key]);
}
}
}