PhpBrew\Command\InstallCommand::parseSemanticOptions PHP Метод

parseSemanticOptions() публичный Метод

public parseSemanticOptions ( array &$args )
$args array
    public function parseSemanticOptions(array &$args)
    {
        $settings = array();
        $definitions = array('as' => '*', 'like' => '*', 'using' => '*+');
        // XXX: support 'using'
        foreach ($definitions as $k => $requirement) {
            $idx = array_search($k, $args);
            if ($idx !== false) {
                if ($requirement == '*') {
                    // Find the value next to the position
                    list($key, $val) = array_splice($args, $idx, 2);
                    $settings[$key] = $val;
                } elseif ($requirement == '*+') {
                    $values = array_splice($args, $idx, 2);
                    $key = array_shift($values);
                    $settings[$key] = $values;
                }
            }
        }
        return $settings;
    }