diff --git a/src/functions.php b/src/functions.php index 628b503..a29be44 100644 --- a/src/functions.php +++ b/src/functions.php @@ -32,25 +32,31 @@ function _array(array $array = []): Swoole\ArrayObject class SwooleLibrary { - public static $options = []; + /** + * @var array + */ + public static array $options = []; } -function swoole_library_set_options(array $options) +/** + * @param array $options + */ +function swoole_library_set_options(array $options): void { SwooleLibrary::$options = $options; } -function swoole_library_get_options() +function swoole_library_get_options(): array { return SwooleLibrary::$options; } -function swoole_library_set_option(string $key, $value) +function swoole_library_set_option(string $key, mixed $value): void { SwooleLibrary::$options[$key] = $value; } -function swoole_library_get_option(string $key) +function swoole_library_get_option(string $key): mixed { return SwooleLibrary::$options[$key] ?? null; }