From 439598d7ee4bcedffec0aea2f3b6f76f6fc785cb Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 18 Mar 2021 16:28:39 +0200 Subject: [PATCH] cleanup --- application/Espo/Core/Console/Params.php | 38 ------------------------ 1 file changed, 38 deletions(-) diff --git a/application/Espo/Core/Console/Params.php b/application/Espo/Core/Console/Params.php index 2899cc82a1..1054c7f8d2 100644 --- a/application/Espo/Core/Console/Params.php +++ b/application/Espo/Core/Console/Params.php @@ -111,42 +111,4 @@ class Params { return $this->argumentList[$index] ?? null; } - - public static function fromArgv(array $argv) : self - { - $argumentList = []; - $options = []; - $flagList = []; - - $skipIndex = 2; - - foreach ($argv as $i => $item) { - if ($i < $skipIndex) { - continue; - } - - if (strpos($item, '--') === 0 && strpos($item, '=') > 2) { - list($name, $value) = explode('=', substr($item, 2)); - - $name = Util::hyphenToCamelCase($name); - - $options[$name] = $value; - } - else if (strpos($item, '--') === 0) { - $flagList[] = Util::hyphenToCamelCase(substr($item, 2)); - } - else if (strpos($item, '-') === 0) { - $flagList[] = substr($item, 1); - } - else { - $argumentList[] = $item; - } - } - - return new self([ - 'argumentList' => $argumentList, - 'options' => $options, - 'flagList' => $flagList, - ]); - } }