| Conditions | 3 |
| Paths | 3 |
| Total Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 53 | public static function getMeterType($name): ?MeterTypeEnum |
||
| 54 | { |
||
| 55 | $cleanedName = strtolower(trim($name)); |
||
| 56 | if (!key_exists($cleanedName, self::$telcoms)) |
||
| 57 | throw new ClubKonnectErrorException("No Meter Type available with the name '$name'", 999); |
||
| 58 | if (!key_exists($cleanedName, self::$cache)) { |
||
| 59 | self::$cache[$cleanedName] = new MeterTypeEnum(self::$telcoms[$cleanedName], $cleanedName); |
||
| 60 | } |
||
| 61 | return self::$cache[$cleanedName]; |
||
| 62 | } |
||
| 63 | |||
| 69 |