This commit is contained in:
zimoyin
2026-03-13 20:27:18 +08:00
parent 9ddec3dfb9
commit 18254d82f5
9 changed files with 102 additions and 10 deletions
@@ -150,6 +150,19 @@ class ProcessContextBuilder
$builder->isOperatorCard = $context->isOperatorCard();
$builder->stepDurations = $context->getStepDurations();
// 遍历当前类的属性,检查哪些未被修改(对比默认值)
$reflection = new \ReflectionClass($builder);
$unmodifiedProperties = [];
foreach ($reflection->getProperties() as $property) {
$property->setAccessible(true); // 允许访问私有/受保护属性
$defaultValue = $reflection->getDefaultProperties()[$property->getName()] ?? null;
if ($property->getValue($builder) === $defaultValue) {
$unmodifiedProperties[] = $property->getName();
}
}
if (empty($unmodifiedProperties)){
Logger::warn("from ProcessContext 创建 ProcessContextBuilder 时存在未修改的属性");
}
return $builder;
}