mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
chore: codeql and linter
This commit is contained in:
1 parent
82a0215eb9
commit
d3119238ea
6 files changed
+29
-29
No files matched your search
+4
-4
@@ -44,13 +44,13 @@ class Abuse
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all logs older than $datetime
|
||||
* Delete all logs older than $timestamp
|
||||
*
|
||||
* @param string $datetime
|
||||
* @param int $timestamp
|
||||
* @return bool
|
||||
*/
|
||||
public function cleanup(string $datetime): bool
|
||||
public function cleanup(int $timestamp): bool
|
||||
{
|
||||
return $this->adapter->cleanup($datetime);
|
||||
return $this->adapter->cleanup($timestamp);
|
||||
}
|
||||
}
|
||||
@@ -90,14 +90,14 @@ class ReCaptcha extends Adapter
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete logs older than $datetime
|
||||
* Delete logs older than $timestamp
|
||||
*
|
||||
* @param string $datetime
|
||||
* @param int $timestamp
|
||||
* @return bool
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function cleanup(string $datetime): bool
|
||||
public function cleanup(int $timestamp): bool
|
||||
{
|
||||
throw new Exception('Method not supported');
|
||||
}
|
||||
|
||||
@@ -23,10 +23,10 @@ class RedisCluster extends TimeLimit
|
||||
}
|
||||
|
||||
/**
|
||||
* Get count for a key at specific datetime
|
||||
* Get count for a key at specific timestamp
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $datetime
|
||||
* @param int $timestamp
|
||||
* @return integer
|
||||
*/
|
||||
protected function count(string $key, int $timestamp): int
|
||||
@@ -51,10 +51,10 @@ class RedisCluster extends TimeLimit
|
||||
}
|
||||
|
||||
/**
|
||||
* Record a hit for a key at specific datetime
|
||||
* Record a hit for a key at specific timestamp
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $datetime
|
||||
* @param int $timestamp
|
||||
* @return void
|
||||
*/
|
||||
protected function hit(string $key, int $timestamp): void
|
||||
|
||||
@@ -13,13 +13,15 @@ use Utopia\Database\Database;
|
||||
|
||||
class DatabaseTest extends Base
|
||||
{
|
||||
protected static ?Database $db = null;
|
||||
protected static Database $db;
|
||||
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
if (self::$db === null) {
|
||||
self::$db = self::initialiseDatabase();
|
||||
if (isset(self::$db)) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$db = self::initialiseDatabase();
|
||||
}
|
||||
|
||||
private static function initialiseDatabase(): Database
|
||||
@@ -50,9 +52,8 @@ class DatabaseTest extends Base
|
||||
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
if (self::$db !== null) {
|
||||
if (isset(self::$db)) {
|
||||
self::$db->delete();
|
||||
self::$db = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,10 +8,7 @@ use Utopia\Exception;
|
||||
|
||||
class RedisClusterTest extends Base
|
||||
{
|
||||
/**
|
||||
* @var \RedisCluster|null
|
||||
*/
|
||||
protected static ?\RedisCluster $redis = null;
|
||||
protected static \RedisCluster $redis;
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
@@ -19,9 +16,11 @@ class RedisClusterTest extends Base
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
if (self::$redis === null) {
|
||||
self::$redis = self::initialiseRedis();
|
||||
if (isset(self::$redis)) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$redis = self::initialiseRedis();
|
||||
}
|
||||
|
||||
private static function initialiseRedis(): \RedisCluster
|
||||
@@ -44,9 +43,8 @@ class RedisClusterTest extends Base
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
if (self::$redis !== null) {
|
||||
if (isset(self::$redis)) {
|
||||
self::$redis->close();
|
||||
self::$redis = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ use Utopia\Exception;
|
||||
|
||||
class RedisTest extends Base
|
||||
{
|
||||
protected static ?\Redis $redis = null;
|
||||
protected static \Redis $redis;
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
@@ -17,9 +17,11 @@ class RedisTest extends Base
|
||||
*/
|
||||
public static function setUpBeforeClass(): void
|
||||
{
|
||||
if (self::$redis === null) {
|
||||
self::$redis = self::initialiseRedis();
|
||||
if (isset(self::$redis)) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::$redis = self::initialiseRedis();
|
||||
}
|
||||
|
||||
private static function initialiseRedis(): \Redis
|
||||
@@ -39,9 +41,8 @@ class RedisTest extends Base
|
||||
*/
|
||||
public static function tearDownAfterClass(): void
|
||||
{
|
||||
if (self::$redis !== null) {
|
||||
if (isset(self::$redis)) {
|
||||
self::$redis->close();
|
||||
self::$redis = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user