From 704489a95ed9ab7748ed5671ed1707c0f19b34da Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 14 Aug 2016 12:10:51 +0200 Subject: [PATCH] Added shell arg handler --- Utils/ArrayUtils.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Utils/ArrayUtils.php b/Utils/ArrayUtils.php index c1803cb58..10f8a8eba 100644 --- a/Utils/ArrayUtils.php +++ b/Utils/ArrayUtils.php @@ -221,4 +221,13 @@ class ArrayUtils return $csv; } + + public static function getArg(string $id, array $args) + { + if(($key = array_search($id, $args)) === false || $key === count($args) - 1) { + return null; + } + + return $args[$key+1]; + } }