| Total Complexity | 5 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Coverage | 80% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class GuardException extends Exception |
||
| 10 | { |
||
| 11 | public static function invalidCollectionType(string $collectionType): self |
||
| 12 | { |
||
| 13 | return new self("Only available options: array, map or list. Selected: $collectionType"); |
||
| 14 | } |
||
| 15 | |||
| 16 | 2 | public static function invalidEnforceType(string $typeToEnforce): self |
|
| 17 | { |
||
| 18 | 2 | return new self("TypedArrays objects can only enforce scalars and objects. Tried to enforce: $typeToEnforce"); |
|
| 19 | } |
||
| 20 | |||
| 21 | 14 | public static function keysNotAllowedInList(): self |
|
| 22 | { |
||
| 23 | 14 | return new self('This TypedArray object is a list and can not have keys.'); |
|
| 24 | } |
||
| 25 | |||
| 26 | 14 | public static function keysRequiredInMap(): self |
|
| 29 | } |
||
| 30 | |||
| 31 | 26 | public static function immutableCannotMutate(): self |
|
| 32 | { |
||
| 36 |