| @@ 53-60 (lines=8) @@ | ||
| 50 | * |
|
| 51 | * @throws \Kerox\Messenger\Exception\MessengerException |
|
| 52 | */ |
|
| 53 | private function isBool($key, $value): void |
|
| 54 | { |
|
| 55 | if (!\is_bool($value) && |
|
| 56 | \in_array($key, [self::CONFIG_KEY_NLP_ENABLED, self::CONFIG_KEY_VERBOSE], true) |
|
| 57 | ) { |
|
| 58 | throw new InvalidTypeException(sprintf('%s must be a boolean.', $key)); |
|
| 59 | } |
|
| 60 | } |
|
| 61 | ||
| 62 | /** |
|
| 63 | * @param int|string $key |
|
| @@ 68-75 (lines=8) @@ | ||
| 65 | * |
|
| 66 | * @throws \Kerox\Messenger\Exception\MessengerException |
|
| 67 | */ |
|
| 68 | private function isString($key, $value): void |
|
| 69 | { |
|
| 70 | if (!\is_string($value) && |
|
| 71 | \in_array($key, [self::CONFIG_KEY_CUSTOM_TOKEN, self::CONFIG_KEY_MODEL], true) |
|
| 72 | ) { |
|
| 73 | throw new InvalidTypeException(sprintf('%s must be a string.', $key)); |
|
| 74 | } |
|
| 75 | } |
|
| 76 | ||
| 77 | /** |
|
| 78 | * @param int|string $key |
|