添加方法参数变量约束

This commit is contained in:
thinkphp
2016-01-21 12:21:04 +08:00
parent 680aa8cd66
commit 4f511dc3e9
6 changed files with 35 additions and 36 deletions

View File

@@ -30,7 +30,7 @@ class Log
protected static $alarm = null;
// 日志初始化
public static function init($config = [])
public static function init(array $config = [])
{
$type = isset($config['type']) ? $config['type'] : 'File';
$class = (!empty($config['namespace']) ? $config['namespace'] : '\\think\\log\\driver\\') . ucwords($type);
@@ -39,7 +39,7 @@ class Log
}
// 通知初始化
public static function alarm($config = [])
public static function alarm(array $config = [])
{
$type = isset($config['type']) ? $config['type'] : 'Email';
$class = (!empty($config['namespace']) ? $config['namespace'] : '\\think\\log\\alarm\\') . ucwords($type);