protected function interpolate($message, array $context = [])
    {
        $replace = [];
        foreach ($context as $key => $val) {
            // check that the value can be casted to string
            if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {
                $replace['{' . $key . '}'] = $val;
            }
        }

        return strtr($message, $replace);
    }
protected function interpolate($message, array $context = [])
    {
        $replace = [];
        foreach ($context as $key => $val) {
            // check that the value can be casted to string
            if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {
                $replace['{' . $key . '}'] = $val;
            }
        }

        return strtr($message, $replace);
    }
protected function interpolate ( $ message , array $ context = [ ] ) { $ replace = [ ] ; foreach ( $ context as $ key => $ val ) { // check that the value can be casted to string if ( ! is_array ( $ val ) && ( ! is_object ( $ val ) || method_exists ( $ val , '__toString' ) ) ) { $ replace [ '{' . $ key . '}' ] = $ val ; } } return strtr ( $ message , $ replace ) ; }
Interpolates context values into the message placeholders for exceptions

@param string $message
@param array $context
@return string
Interpolates context values into the message placeholders for exceptions