Skip to content

Commit

Permalink
规范代码(PER-CS2.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
big-dream authored and liu21st committed Oct 15, 2024
1 parent 20d5fb4 commit 2077961
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lang/zh-cn.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions src/think/Validate.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
Expand All @@ -8,7 +9,7 @@
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
declare (strict_types = 1);
declare (strict_types=1);

namespace think;

Expand Down Expand Up @@ -1212,7 +1213,7 @@ public function unique($value, $rule, array $data = [], string $field = ''): boo

if (str_contains($rule[0], '\\')) {
// 指定模型类
$db = new $rule[0];
$db = new $rule[0]();
} else {
$db = $this->db->name($rule[0]);
}
Expand Down Expand Up @@ -1845,7 +1846,7 @@ protected function parseErrorMsg(string $msg, $rule, string $title)
$msg = str_replace(
[':attribute', ':1', ':2', ':3'],
[$title, $array[0], $array[1], $array[2]],
$msg
$msg,
);

if (str_contains($msg, ':rule')) {
Expand Down

0 comments on commit 2077961

Please sign in to comment.