添加方法参数变量约束

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

@@ -16,17 +16,17 @@ class Cookie
protected static $config = [
// cookie 名称前缀
'prefix' => '',
'prefix' => '',
// cookie 保存时间
'expire' => 0,
'expire' => 0,
// cookie 保存路径
'path' => '/',
'path' => '/',
// cookie 有效域名
'domain' => '',
'domain' => '',
// cookie 启用安全传输
'secure' => false,
'secure' => false,
// httponly设置
'httponly' => '',
'httponly' => '',
];
/**
@@ -34,7 +34,7 @@ class Cookie
* @param array $config
* @return void
*/
public static function init($config = [])
public static function init(array $config = [])
{
self::$config = array_merge(self::$config, array_change_key_case($config));
if (!empty(self::$config['httponly'])) {
@@ -157,7 +157,7 @@ class Cookie
}
return;
}
private static function jsonFormatProtect(&$val, $key, $type = 'encode')
{
if (!empty($val) && true !== $val) {