Interpolates log variables into the defined log format.

@param  array $variables The log variables.
@return string
760548
protected function interpolate(array $variables = array())
    {
        $template = $this->logFormat;

        if (!isset($variables['context'])) {
            $variables['context'] = '';
        }
        $this->reverseJsonInContext($variables['context']);
        if (!$variables['context']) {
            $template = str_replace('%context%', '', $template);
            unset($variables['context']);
        }

        foreach ($variables as $key => $value) {
            if (strpos($template, '%'. $key .'%') === false) {
                continue;
            }
            $template = str_replace(
                '%' . $key . '%',
                $this->export($value),
                $template
            );
        }

        return $template;
    }
779575
private function extractModifiedVariableNames(array $nodes)
    {
        $modifiedNames = array();
        foreach ($nodes as $node) {
            if (!$node) {
                continue;
            }

            $variableNameNode = $node;
            if ($node instanceof Node\Arg) {
                $variableNameNode = $node->value;
            }

            if ($node instanceof Node\Expr\ArrayDimFetch) {
                $variableNameNode = $node->var;
            }

            if (!($variableNameNode instanceof Node\Expr\Variable)) {
                continue;
            }

            $variableName = $this->convertVariableNameToString($variableNameNode);
            $modifiedNames[] = $variableName;
        }

        return array_unique($modifiedNames);
    }
185631
public static function convertVariableToString($variable) {
		$string = '';
		if (is_array($variable)) {
			$string = self::viewArray($variable);
		} elseif (is_object($variable)) {
			$string = '<strong>|Object:<pre>';
			$string .= print_r($variable, TRUE);
			$string .= '</pre>|</strong>';
		} elseif ((string) $variable !== '') {
			$string = '<strong>|' . htmlspecialchars((string) $variable) . '|</strong>';
		} else {
			$string = '<strong>| debug |</strong>';
		}

		return $string;
	}
756388
public function addVariables(array $variables)
    {
        foreach ($variables as $name => $value) {
            $this->addVariable($name, $value);
        }

        return $this;
    }
599577
protected function preprocessLinks(Variables $variables) {
    parent::preprocessLinks($variables);

    $operations = !!mb_strpos($variables->theme_hook_original, 'operations');

    // Make operations button small, not smaller ;).
    // Bootstrap basetheme override.
    if ($operations) {
      $variables->toggle['#attributes']['class'] = ['btn-sm'];
      $variables['btn_context'] = 'operations';
      $variables['alignment'] = 'right';
    }

  }
489840
public function constructJavaScript($variables)
    {
        return $this->constructNamespace() . collect($variables)->map(function ($value, $name) {
            return $this->initializeVariable($name, $value);
        })->implode('');
    }
246915
public function setVars($variables)
    {
        if (!is_array($variables) && !$variables instanceof ArrayAccess) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Expected array or ArrayAccess object; received "%s"',
                (is_object($variables) ? get_class($variables) : gettype($variables))
            ));
        }

        // Enforce a Variables container
        if (!$variables instanceof Variables) {
            $variablesAsArray = array();
            foreach ($variables as $key => $value) {
                $variablesAsArray[$key] = $value;
            }
            $variables = new Variables($variablesAsArray);
        }

        $this->__vars = $variables;
        return $this;
    }
574728
public function variables(array $variables)
    {
        $this->options['variables'] = Arr::mergeRecursive(
            $this->options['variables'] ?? [],
            $variables
        );

        return $this;
    }
430590
private function transformRouteVariables(string $route, array $variables) : string
    {
        list($valueToReplace, , $parametersVariables) = array_pad(
            $variables,
            3,
            null
        );

        if (isset($parametersVariables)) {
            return str_replace(
                $valueToReplace,
                '('.reset($parametersVariables).')',
                $route
            );
        }

        return str_replace($valueToReplace, '([^/]+)', $route);
    }
650358
public function interpolate(array $record)
    {
        if (false === strpos($record['message'], '{')) {
            return $record;
        }

        $replacements = array();
        foreach ($record['context'] as $key => $val) {
            if (is_null($val)
                || is_scalar($val)
                || (is_object($val) && method_exists($val, "__toString"))
            ) {
                $replacements['{'.$key.'}'] = $val;
            } elseif (is_object($val)) {
                $replacements['{'.$key.'}'] = '[object '.get_class($val).']';
            } else {
                $replacements['{'.$key.'}'] = '['.gettype($val).']';
            }
        }

        $record['message'] = strtr($record['message'], $replacements);

        return $record;
    }
748828
protected function varToString($var)
    {
        if (is_object($var)) {
            return get_class($var);
        }

        if (is_array($var)) {
            return 'Array';
        }

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

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

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

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

        return (string) gettype($var);
    }
619986
static public function interpolate($str, array $vars) {
        $keys = array_keys($vars);
        $vals = array_values($vars);
        // surround keys by "%"
        array_walk(
            $keys, function (&$s) {
                $s = '%' . $s . '%';
            }
        );
        $str = str_replace($keys, $vals, $str);
        return $str;
    }
728376
public function actionProviderInfos(array $variables = array())
    {
        if(!empty($variables['handle']))
        {
            $provider = craft()->oauth->getProvider($variables['handle'], false, true);

            if($provider)
            {
                $variables['infos'] = craft()->oauth->getProviderInfos($variables['handle']);;
                $variables['provider'] = $provider;

                $configInfos = craft()->config->get('providerInfos', 'oauth');

                if(!empty($configInfos[$variables['handle']]))
                {
                    $variables['configInfos'] = $configInfos[$variables['handle']];
                }

                $this->renderTemplate('oauth/providers/_edit', $variables);
            }
            else
            {
                throw new HttpException(404);
            }
        }
        else
        {
            throw new HttpException(404);
        }
    }
408557
public function buildString(array $variables = [], bool $useExisting = true): string
    {
        if ($useExisting === true) {
            $variables = \array_merge($this->variables, $variables);
        }

        $tmp = [];
        foreach ($variables as $name => $val) {
            if ($val !== null) {
                $tmp[] = $name.'='.\urlencode((string)$val);
            }
        }

        $ret = '';
        if (\count($tmp) > 0) {
            $ret .= '?'.\implode('&', $tmp);
        }
        return $ret;
    }
636460
protected function _updateEnvVars(array $vars) {
        return f\reduce_assoc(
            function ($o, $var, $key) {
                // Store the current value
                $o[$key] = getenv($key);
                // Put the new value
                putenv("{$key}={$var}");
                return $o;
            },
            array(),
            $vars
        );
    }
257487
public function addVariables($variables)
    {
        if ($variables instanceof stdClass) {
            $variables = (array) $variables;
        } elseif ($variables instanceof Traversable) {
            $variables = iterator_to_array($variables);
        } elseif (! is_array($variables)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid variables provided; must be an array or Traversable '
                . 'or instance of stdClass, "%s" received.',
                is_object($variables) ? get_class($variables) : gettype($variables)
            ));
        }
        $this->container = array_merge($this->container, $variables);

        return $this;
    }
960032
public function getVariable($variable) {
		
		if(true === isset($this -> variables[$variable])) {
			return $this -> variables[$variable];
		}
	}