From 12461e67505fb37a9a7f087cd1ac9986da8deb41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Thu, 3 Sep 2020 18:37:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- system/Snowflake.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/system/Snowflake.php b/system/Snowflake.php index b4a3e9bd..e7a95f3f 100644 --- a/system/Snowflake.php +++ b/system/Snowflake.php @@ -131,16 +131,16 @@ class Snowflake /** * @param $fileName * @param $content - * @param int $is_append + * @param null $is_append * @return false|int|mixed */ - public static function writeFile($fileName, $content, $is_append = FILE_APPEND) + public static function writeFile($fileName, $content, $is_append = null) { - if (self::inCoroutine()) { - return Coroutine::writeFile($fileName, $content, $is_append); - } else { - return file_put_contents($fileName, $content, $is_append); + $params = [$fileName, $content]; + if ($is_append !== null) { + $params[] = $is_append; } + return !self::inCoroutine() ? file_put_contents(...$params) : Coroutine::writeFile(...$params); }