Skip to content

Commit

Permalink
Merge pull request #1 from jiangwennn/dev/bugfix
Browse files Browse the repository at this point in the history
bug fix
  • Loading branch information
jiangwennn authored Dec 6, 2021
2 parents b81c846 + 0fc87e2 commit 920664e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/X7/Module/X7Detection/Model/DetectResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ public static function make($paramArr)
foreach ($properties as $property) {
if (!isset($paramArr[$property->name]) && !in_array($property->name, static::$optionalFields)) {
throw new RuntimeException("字段 {$property->name} 缺失 in paramArr");
} elseif ($property->name == "sensitiveWords" && !is_array($paramArr[$property->name])) {
throw new RuntimeException("字段 {$property->name} 类型有误 in paramArr");
} elseif ($property->name == "sensitiveWords") {
if (!is_array($paramArr[$property->name])) {
throw new RuntimeException("字段 {$property->name} 类型有误 in paramArr");
}
} elseif (!empty($paramArr[$property->name]) && !is_scalar($paramArr[$property->name])) {
throw new RuntimeException("字段 {$property->name} 类型有误 in paramArr");
}
Expand Down

0 comments on commit 920664e

Please sign in to comment.