From df3571534ce9f9c1b037954bf8cb05c04f62a5ad Mon Sep 17 00:00:00 2001 From: wolfcode <37436228+wolf-leo@users.noreply.github.com> Date: Tue, 18 Jun 2024 17:36:23 +0800 Subject: [PATCH] Adjust the `editor_textarea` function to allow `$detail` parameter as nullable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function signature for `editor_textarea` in common.php has been updated to accept `$detail` as a nullable string. This change allows the function to handle cases where `$detail` might not be provided or could be null. ```php - function editor_textarea(string $detail, string $name = 'desc', string $placeholder = '请输入'): string + function editor_textarea(?string $detail, string $name = 'desc', string $placeholder = '请输入'): string ``` --- app/common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common.php b/app/common.php index 45e1a61..087e26e 100644 --- a/app/common.php +++ b/app/common.php @@ -101,12 +101,12 @@ if (!function_exists('auth')) { } /** - * @param string $detail + * @param string|null $detail * @param string $name * @param string $placeholder * @return string */ - function editor_textarea(string $detail, string $name = 'desc', string $placeholder = '请输入'): string + function editor_textarea(?string $detail, string $name = 'desc', string $placeholder = '请输入'): string { $editor_type = sysConfig('site', 'editor_type'); return match ($editor_type) {