From 4557165a0c22a9aa0fa4b089734c7509536b8444 Mon Sep 17 00:00:00 2001 From: Joshua Ramon Enslin Date: Mon, 24 Jul 2023 14:26:18 +0200 Subject: [PATCH] Replace check for uniqueness of checked sections in MDPuqi --- src/Checks/Puqi/MDPuqi.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Checks/Puqi/MDPuqi.php b/src/Checks/Puqi/MDPuqi.php index ec90634..0a30509 100644 --- a/src/Checks/Puqi/MDPuqi.php +++ b/src/Checks/Puqi/MDPuqi.php @@ -1110,16 +1110,16 @@ final class MDPuqi { */ 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"); + } + } /**