apply StyleCI recommendation
This commit is contained in:
parent
a203e6322b
commit
7b2f0ff302
@ -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'] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user