fix: get flags return type (#3)

This commit is contained in:
Victor Westerlund 2023-03-27 18:03:48 +02:00 committed by GitHub
parent 8296bf0efd
commit cb38a4007f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,7 +34,8 @@
// Get args array from stack entry by index // Get args array from stack entry by index
$args = $stack[$idx]["args"]; $args = $stack[$idx]["args"];
return !empty($args) ? end($args) : null; // Return null if no arguments provided or not a valid int flag
return !empty($args) && is_int(end($args)) ? end($args) : null;
} }
/* ---- */ /* ---- */