Replace check for uniqueness of checked sections in MDPuqi

This commit is contained in:
jrenslin committed 2023-07-24 14:26:18 +02:00
1 parent 9b1af6eb17
commit 4557165a0c
1 file changed
+4 -4
+4 -4
View File
@@ -1110,16 +1110,16 @@ public function markSectionChecked(MDPuqiCheckSection $section):void {
*/
public function validateChecksCompleteness():void {
if (array_unique($this->_checkedSections) !== $this->_checkedSections) {
throw new Exception("A section has been checked twice");
}
foreach (MDPuqiCheckSection::cases() as $case) {
if (!in_array($case, $this->_checkedSections, true)) {
throw new Exception("Section " . $case->name . " was not checked");
}
}
if (count(MDPuqiCheckSection::cases()) < count($this->_checkedSections)) {
throw new Exception("A section has been checked twice");
}
}
/**