test
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user