From 0d1d9cee82a8189982c40407512fea549a101930 Mon Sep 17 00:00:00 2001 From: ArrayIterator Date: Fri, 10 Nov 2023 17:59:10 +0700 Subject: [PATCH] add exception --- src/Utils/Lookup.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Utils/Lookup.php b/src/Utils/Lookup.php index 37f74b5..c633c4d 100644 --- a/src/Utils/Lookup.php +++ b/src/Utils/Lookup.php @@ -110,6 +110,11 @@ public static function resourceOpcode( $opcode = $opcode->getValue(); } if (is_string($opcode)) { + if ($opcode === '') { + throw new EmptyArgumentException( + 'OPCODE could not be empty string or whitespace only' + ); + } $opcode = strtoupper(trim($opcode)); $code = self::OPCODE_LIST[$opcode]??null; if (!$opcode) {