mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
fix code to phpstan-level-2
This commit is contained in:
@@ -24,11 +24,11 @@ class LightCache
|
||||
private static $config = [];
|
||||
|
||||
/**
|
||||
* @param $config
|
||||
* @param array $config 配置
|
||||
* @throws Exception
|
||||
* @return bool|mixed
|
||||
* @return bool|mixed 返回失败(false)或创建SwooleTable成功结果
|
||||
*/
|
||||
public static function init($config)
|
||||
public static function init(array $config)
|
||||
{
|
||||
self::$config = $config;
|
||||
self::$kv_table = new Table($config['size'], $config['hash_conflict_proportion']);
|
||||
@@ -169,7 +169,7 @@ class LightCache
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $value
|
||||
* @param mixed $value
|
||||
* @throws ZMException
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
@@ -38,8 +38,7 @@ class LightCacheInside
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array|int|string $value
|
||||
* @return mixed
|
||||
* @param array|int|string $value
|
||||
*/
|
||||
public static function set(string $table, string $key, $value): bool
|
||||
{
|
||||
@@ -58,13 +57,10 @@ class LightCacheInside
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
* @param $size
|
||||
* @param $str_size
|
||||
* @param int $conflict_proportion
|
||||
* @param float|int $conflict_proportion
|
||||
* @throws ZMException
|
||||
*/
|
||||
private static function createTable($name, $size, $str_size, $conflict_proportion = 0)
|
||||
private static function createTable(string $name, int $size, int $str_size, $conflict_proportion = 0)
|
||||
{
|
||||
self::$kv_table[$name] = new Table($size, $conflict_proportion);
|
||||
self::$kv_table[$name]->column('value', Table::TYPE_STRING, $str_size);
|
||||
|
||||
@@ -12,10 +12,7 @@ class ZMAtomic
|
||||
/** @var Atomic[] */
|
||||
public static $atomics;
|
||||
|
||||
/**
|
||||
* @param $name
|
||||
*/
|
||||
public static function get($name): ?Atomic
|
||||
public static function get(string $name): ?Atomic
|
||||
{
|
||||
return self::$atomics[$name] ?? null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user