DbPatch_Core_Console::parseOptions PHP Метод

parseOptions() защищенный Метод

protected parseOptions ( ) : void
Результат void
    protected function parseOptions()
    {
        $options = array();
        foreach ($this->arguments as $key => $argument) {
            if (substr($argument, 0, 2) == '--') {
                $tmpArg = explode('=', $argument);
                $argName = strtolower(substr($tmpArg[0], 2));
                $argValue = '';
                if (isset($tmpArg[1])) {
                    $argValue = $tmpArg[1];
                }
                // parse boolean values
                switch (strtolower($argValue)) {
                    case 'yes':
                    case 'true':
                    case '':
                        $argValue = true;
                        break;
                    case 'no':
                    case 'false':
                        $argValue = false;
                        break;
                }
                $options[$argName] = $argValue;
            } elseif ($key > 0) {
                $options[$argument] = $argument;
            }
        }
        $this->options = $options;
    }