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