Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ function dump(...$vars)
* 获取环境变量值
* @access public
* @param string $name 环境变量名(支持二级 .号分割)
* @param string $default 默认值
* @param mixed $default 默认值
* @return mixed
*/
function env(?string $name = null, $default = null)
function env(?string $name = null, mixed $default = null)
{
return Env::get($name, $default);
}
Expand Down
4 changes: 2 additions & 2 deletions src/think/Env.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function load(string $file): void
* @param mixed $default 默认值
* @return mixed
*/
public function get(?string $name = null, $default = null)
public function get(?string $name = null, mixed $default = null)
{
if (is_null($name)) {
return $this->data;
Expand All @@ -81,7 +81,7 @@ public function get(?string $name = null, $default = null)
return $this->getEnv($name, $default);
}

protected function getEnv(string $name, $default = null)
protected function getEnv(string $name, mixed $default = null)
{
$result = getenv('PHP_' . $name);

Expand Down