Converts an array of key value pairs to lowercase

@param array $vars key value pairs
@return array
428306
protected function arrayToLowercase($vars)
    {
        $result = array();

        foreach ($vars as $k => $v) {
            if (is_array($v)) {
                $result[strtolower($k)] = $this->arrayToLowercase($v);
            } else {
                $result[strtolower($k)] = strtolower($v);
            }
        }

        return $result;
    }
525601
public function sortAdminColumns($vars)
    {
        if (!isset($vars['orderby'])) {
            return $vars;
        }

        $admin_columns = $this->getAdminColumns();
        if (!Arr::iterable($admin_columns)) {
            return $vars;
        }

        foreach ($admin_columns as $k) {
            if ($vars['orderby'] !== $k) {
                continue;
            }

            $vars = array_merge($vars, array(
                'meta_key'=> $k,
                'orderby' => 'meta_value'
            ));

            break;
        }
        return $vars;
    }
1149549
protected function deepClone($vars)
    {
        if (is_object($vars)) {
            $vars = get_object_vars($vars);
            foreach ($vars as $key => $value) {
                if (is_array($value) || is_object($value)) {
                    $vars[$key] = $this->deepClone($value);
                }
                unset($value);
            }
            return (object)$vars;
        }
        if (!is_array($vars)) {
            return $vars;
        }
        foreach ($vars as &$value) {
            if (is_array($value) || is_object($value)) {
                $value = $this->deepClone($value);
            }
            unset($value);
        }
        return $vars;
    }
597301
private function varToString($var): string
    {
        if (\is_object($var)) {
            return \sprintf('an object of type %s', \get_class($var));
        }

        if (\is_array($var)) {
            $a = [];
            foreach ($var as $k => $v) {
                $a[] = \sprintf('%s => ...', $k);
            }

            return \sprintf('an array ([%s])', \mb_substr(\implode(', ', $a), 0, 255));
        }

        if (\is_resource($var)) {
            return \sprintf('a resource (%s)', \get_resource_type($var));
        }

        if (null === $var) {
            return 'null';
        }

        if (false === $var) {
            return 'a boolean value (false)';
        }

        if (true === $var) {
            return 'a boolean value (true)';
        }

        if (\is_string($var)) {
            return \sprintf('a string ("%s%s")', \mb_substr($var, 0, 255), \mb_strlen($var) > 255 ? '...' : '');
        }

        if (\is_numeric($var)) {
            return \sprintf('a number (%s)', (string) $var);
        }

        return (string) $var;
    }
878548
protected static function interpolateVars($str, array $vars)
	{
		return preg_replace_callback(
			'(\\{@(\\w+)\\})',
			function ($m) use ($vars)
			{
				return (isset($vars[$m[1]])) ? $vars[$m[1]] : '';
			},
			$str
		);
	}
786133
public function parse(array $vars = [])
    {
        foreach ($vars as $_assign_key => $_assign_value) {
            $this->engine->assign($_assign_key, $_assign_value);
        }

        return $this->engine->fetch('string:' . $this->string);
    }
166283
public function inflectPackageVars($vars)
    {
        $restrictedWords = implode('|', array_keys($this->locations));

        $vars['name'] = strtolower($vars['name']);
        $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
            '$1',
            $vars['name']
        );

        return $vars;
    }
1153435
public static function array_change_value_case(array $values)
    {
        $newValues = [];

        foreach ($values as $key => $value) {
            $newValues[$key] = self::strtolower($value);
        }

        return $newValues;
    }
47463
protected static function escapeSet(array $values)
    {
        $escaped_values = [];

        foreach ($values as $value) {
            if (is_array($value)) {
                $escaped_values[] =
                    sprintf("(%s)", join(', ', static::escapeSet($value)));
            } else {
                $escaped_values[] = '$*';
            }
        }

        return $escaped_values;
    }
976708
protected function _fixvars($vars, $oldvars)
    {
        if ($oldvars !== null) {
            $a_oldvars = $this->unserialize($oldvars);
            if (is_array($a_oldvars)) {
                // remove unset keys on oldvars
                foreach ((array)$this->unsets as $var) {
                    if (isset($a_oldvars[$var])) {
                        unset($a_oldvars[$var]);
                    }
                    else {
                        $path = explode('.', $var);
                        $k = array_pop($path);
                        $node = &$this->get_node($path, $a_oldvars);
                        unset($node[$k]);
                    }
                }

                $newvars = $this->serialize(array_merge(
                    (array)$a_oldvars, (array)$this->unserialize($vars)));
            }
            else {
                $newvars = $vars;
            }
        }

        $this->unsets = array();
        return $newvars;
    }
893148
function lowercase(arr) {
  var ret = new Array(arr.length);

  for (var i = 0; i < arr.length; ++i) {
    ret[i] = String(arr[i]).toLowerCase();
  }

  return ret;
}
938523
public function inflectPackageVars($vars)
    {
        if ($vars['type'] == 'mautic-plugin') {
            $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
                return strtoupper($matches[0][1]);
            }, ucfirst($vars['name']));
        }

        return $vars;
    }
901294
protected function _getConfigParamsSelectSnippet($vars)
    {
        $select = '';
        if (is_array($vars) && !empty($vars)) {
            foreach ($vars as &$field) {
                $field = '"' . $field . '"';
            }
            $select = ' and oxvarname in ( ' . implode(', ', $vars) . ' ) ';
        }

        return $select;
    }
294600
public function getParametersAsVars( $vars = array() )
	{
		foreach ( $this->parameters as $qname => $parameter )
		{
			$vars[ $qname ] = $parameter->result;
		}

		return $vars;
	}
1202259
protected function serialize($vars)
    {
        $data = '';
        if (is_array($vars)) {
            foreach ($vars as $var=>$value)
                $data .= $var.'|'.serialize($value);
        }
        else {
            $data = 'b:0;';
        }

        return $data;
    }
513306
public static function lowercase($val): string
    {
        if (!$val || !\is_string($val)) {
            return \is_int($val) ? $val : '';
        }

        if (\function_exists('mb_strtolower')) {
            return \mb_strtolower($val, 'utf-8');
        }

        return \strtolower($val);
    }
666031
public function inflectPackageVars($vars)
    {
        $vars['name'] = strtolower($vars['name']);
        $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
        $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
        $vars['name'] = preg_replace('/-translation$/', '', $vars['name']);

        return $vars;
    }