private static function format($str, array $values = [])
    {
        foreach ($values as $key => $value) {
            $str = preg_replace('/{\s*'.$key.'\s*\}/', $value, $str);
        }

        return $str;
    }