Replace check for uniqueness of checked sections in MDPuqi
This commit is contained in:
		| @@ -1110,16 +1110,16 @@ final class MDPuqi { | |||||||
|      */ |      */ | ||||||
|     public function validateChecksCompleteness():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) { |         foreach (MDPuqiCheckSection::cases() as $case) { | ||||||
|             if (!in_array($case, $this->_checkedSections, true)) { |             if (!in_array($case, $this->_checkedSections, true)) { | ||||||
|                 throw new Exception("Section " . $case->name . " was not checked"); |                 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"); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user