Code Duplication    Length = 11-11 lines in 2 locations

lib/Model/Member.php 2 locations

@@ 600-610 (lines=11) @@
597
	 * @return int
598
	 * @throws MemberLevelException
599
	 */
600
	public static function parseLevelString(string $levelString): int {
601
		$levelString = ucfirst(strtolower($levelString));
602
		$level = array_search($levelString, Member::$DEF_LEVEL);
603
604
		if (!$level) {
605
			$all = implode(', ', array_values(self::$DEF_LEVEL));
606
			throw new MemberLevelException('Available levels: ' . $all);
607
		}
608
609
		return (int)$level;
610
	}
611
612
	/**
613
	 * @param string $typeString
@@ 618-628 (lines=11) @@
615
	 * @return int
616
	 * @throws UserTypeNotFoundException
617
	 */
618
	public static function parseTypeString(string $typeString): int {
619
		$typeString = strtolower($typeString);
620
		$type = array_search($typeString, Member::$DEF_TYPE);
621
622
		if (!$type) {
623
			$all = implode(', ', array_values(self::$DEF_TYPE));
624
			throw new UserTypeNotFoundException('Available types: ' . $all);
625
		}
626
627
		return (int)$type;
628
	}
629
630
}
631