From 7b2f0ff302a24c15a7597c23e3bf03adfabc2dca Mon Sep 17 00:00:00 2001 From: El RIDO Date: Wed, 9 Jun 2021 19:16:22 +0200 Subject: [PATCH] apply StyleCI recommendation --- lib/Data/Database.php | 4 ++-- lib/Persistence/TrafficLimiter.php | 4 ++-- tst/Persistence/TrafficLimiterTest.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Data/Database.php b/lib/Data/Database.php index ca0cc79..ae4da19 100644 --- a/lib/Data/Database.php +++ b/lib/Data/Database.php @@ -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'] : ''; } /** diff --git a/lib/Persistence/TrafficLimiter.php b/lib/Persistence/TrafficLimiter.php index 1146861..930272d 100644 --- a/lib/Persistence/TrafficLimiter.php +++ b/lib/Persistence/TrafficLimiter.php @@ -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; diff --git a/tst/Persistence/TrafficLimiterTest.php b/tst/Persistence/TrafficLimiterTest.php index 2e81d83..aedbf88 100644 --- a/tst/Persistence/TrafficLimiterTest.php +++ b/tst/Persistence/TrafficLimiterTest.php @@ -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); }