src/IntlService.php
protected function replace($text, $replacements)
    {
        if (is_array($replacements)) {
            foreach ($replacements as $var => $replacement) {
                $regex = str_replace('key', preg_quote($var, '/'), $this->translateReplaceRegex);
                $text = preg_replace($regex, $replacement, $text);
            }
        }
        return $text;
    }
protected function replace($text, $replacements)
    {
        if (is_array($replacements)) {
            foreach ($replacements as $var => $replacement) {
                $regex = str_replace('key', preg_quote($var, '/'), $this->translateReplaceRegex);
                $text = preg_replace($regex, $replacement, $text);
            }
        }
        return $text;
    }
protected function replace ( $ text , $ replacements ) { if ( is_array ( $ replacements ) ) { foreach ( $ replacements as $ var => $ replacement ) { $ regex = str_replace ( 'key' , preg_quote ( $ var , '/' ) , $ this -> translateReplaceRegex ) ; $ text = preg_replace ( $ regex , $ replacement , $ text ) ; } } return $ text ; }
Replace text variables.

@param string     $text
@param array|null $replacements

@return string
Replace text variables .