code: protected function interpolate($message, array &$context = array())
      {
          // build a replacement array with braces around the context keys
          \preg_match_all('/\{([a-z0-9_.]+)\}/', $message, $matches);
          $placeholders = \array_unique($matches[1]);
          $replace = array();
          foreach ($placeholders as $key) {
              if (!isset($context[$key])) {
                  continue;
              }
              $val = $context[$key];
              if (!\is_array($val) && (!\is_object($val) || \method_exists($val, '__toString'))) {
                  $replace['{' . $key . '}'] = $val;
              }
          }
          $context = \array_diff_key($context, \array_flip($placeholders));
          if (!$context) {
              $context = $this->debug->meta();
          }
          return \strtr($message, $replace);
      }
docs: Interpolates context values into the message placeholders.
  
  @param string $message message
  @param array  $context optional array of key/values
  interpolated values get removed
  
  @return string