namespace Drupal\Core\EventSubscriber;
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Utility\Error;
if (!$this->isErrorLevelVerbose()) {
// Without verbose logging, use a simple message.
- // We call SafeMarkup::format directly here, rather than use t() since
- // we are in the middle of error handling, and we don't want t() to
- // cause further errors.
- $message = SafeMarkup::format('%type: @message in %function (line %line of %file).', $error);
+ // We use \Drupal\Component\Render\FormattableMarkup directly here,
+ // rather than use t() since we are in the middle of error handling, and
+ // we don't want t() to cause further errors.
+ $message = new FormattableMarkup('%type: @message in %function (line %line of %file).', $error);
}
else {
// With verbose logging, we will also include a backtrace.
// Generate a backtrace containing only scalar argument values.
$error['@backtrace'] = Error::formatBacktrace($backtrace);
- $message = SafeMarkup::format('%type: @message in %function (line %line of %file). <pre class="backtrace">@backtrace</pre>', $error);
+ $message = new FormattableMarkup('%type: @message in %function (line %line of %file). <pre class="backtrace">@backtrace</pre>', $error);
}
}