public function replaceVariables($string, $replaces = [])
    {
        $callback = function ($match) use ($replaces) {
            $variable = trim($match[0], '{}');

            if(array_key_exists($variable, $replaces))
            {
                return $replaces[$variable];
            }

            return $variable;
        };

        return preg_replace_callback('/{.*?}/', $callback, $string);
    }