Skip to content

Commit

Permalink
add exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator committed Nov 10, 2023
1 parent 961bf25 commit 0d1d9ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Utils/Lookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0d1d9ce

Please sign in to comment.