From e8536c3f18b14629e508b03271a4fcdd9c79edef Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 25 Oct 2023 11:11:40 +0900 Subject: [PATCH] refactor: replace empty() --- phpstan-baseline.php | 2 +- system/BaseModel.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 7c60780cc31e..873cd7492294 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -33,7 +33,7 @@ ]; $ignoreErrors[] = [ 'message' => '#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#', - 'count' => 15, + 'count' => 14, 'path' => __DIR__ . '/system/BaseModel.php', ]; $ignoreErrors[] = [ diff --git a/system/BaseModel.php b/system/BaseModel.php index a51ae1efbbe6..4a34fe18fb27 100644 --- a/system/BaseModel.php +++ b/system/BaseModel.php @@ -1463,7 +1463,7 @@ public function validate($data): bool $rules = $this->getValidationRules(); - if (empty($rules)) { + if ($rules === []) { return true; }