apply StyleCI recommendation

This commit is contained in:
El RIDO 2021-06-09 19:16:22 +02:00
parent a203e6322b
commit 7b2f0ff302
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92
3 changed files with 5 additions and 5 deletions

View File

@ -460,7 +460,7 @@ class Database extends AbstractData
public function getValue($namespace, $key = '')
{
$configKey = strtoupper($namespace);
$value = $this->_getConfig($configKey);
$value = $this->_getConfig($configKey);
if ($value === '') {
// initialize the row, so that setValue can rely on UPDATE queries
self::_exec(
@ -640,7 +640,7 @@ class Database extends AbstractData
'SELECT value FROM ' . self::_sanitizeIdentifier('config') .
' WHERE id = ?', array($key), true
);
return $row ? $row['value']: '';
return $row ? $row['value'] : '';
}
/**

View File

@ -171,8 +171,8 @@ class TrafficLimiter extends AbstractPersistence
// this hash is used as an array key, hence a shorter algo is used
$hash = self::getHash('sha256');
$now = time();
$tl = (int) self::$_store->getValue('traffic_limiter', $hash);
$now = time();
$tl = (int) self::$_store->getValue('traffic_limiter', $hash);
self::$_store->purgeValues('traffic_limiter', $now - self::$_limit);
if ($tl > 0 && ($tl + self::$_limit >= $now)) {
$result = false;

View File

@ -12,7 +12,7 @@ class TrafficLimiterTest extends PHPUnit_Framework_TestCase
{
/* Setup Routine */
$this->_path = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'trafficlimit';
$store = Filesystem::getInstance(array('dir' => $this->_path));
$store = Filesystem::getInstance(array('dir' => $this->_path));
ServerSalt::setStore($store);
TrafficLimiter::setStore($store);
}