Skip to content

Commit f255c2d

Browse files
committed
修复env默认值接受类型
1 parent ced4837 commit f255c2d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ function dump(...$vars)
208208
/**
209209
* 获取环境变量值
210210
* @access public
211-
* @param string $name 环境变量名(支持二级 .号分割)
212-
* @param string $default 默认值
211+
* @param ?string $name 环境变量名(支持二级 .号分割)
212+
* @param mixed $default 默认值
213213
* @return mixed
214214
*/
215215
function env(?string $name = null, $default = null)

src/think/Env.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ public function load(string $file): void
5757
/**
5858
* 获取环境变量值
5959
* @access public
60-
* @param string $name 环境变量名
61-
* @param mixed $default 默认值
60+
* @param ?string $name 环境变量名
61+
* @param mixed $default 默认值
6262
* @return mixed
6363
*/
64-
public function get(?string $name = null, $default = null)
64+
public function get(?string $name = null, mixed $default = null)
6565
{
6666
if (is_null($name)) {
6767
return $this->data;

0 commit comments

Comments
 (0)