From 4c84cba83a1a150a8592535943c2a9a9e044ce09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 29 Sep 2021 11:44:51 +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 --- kiri-gii/GiiBase.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/kiri-gii/GiiBase.php b/kiri-gii/GiiBase.php index b2564b2b..7cd24acd 100644 --- a/kiri-gii/GiiBase.php +++ b/kiri-gii/GiiBase.php @@ -7,12 +7,9 @@ namespace Gii; use Database\Connection; use Exception; -use JetBrains\PhpStorm\ArrayShape; - +use Kiri\Core\Json; use ReflectionClass; use ReflectionException; -use Kiri\Abstracts\Input; -use Kiri\Core\Json; use Symfony\Component\Console\Input\InputInterface; /** @@ -178,7 +175,7 @@ abstract class GiiBase foreach ($class->getDefaultProperties() as $key => $val) { $property = $class->getProperty($key); - if ($key == 'primary' || $key == 'table' || $key == 'connection' || $key == 'rules') { + if ($key == 'primary' || $key == 'table' || $key == 'connection' || $key == 'rules') { continue; } if ($property->class != $class->getName()) continue; @@ -247,16 +244,17 @@ abstract class GiiBase } } - if (empty($_array)){ + if (empty($_array)) { $end = " #[" . end($explode) . "] "; - }else{ + } else { $end = " #[" . end($explode) . "(" . implode(',', $_array) . ")] "; } - if (!str_contains($over, $end)){ - $over .= $end; + if (str_contains($over, $end)) { + $over = str_replace($end, '', $over); } + $over .= $end; } }