Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / user / tests / modules / user_hooks_test / user_hooks_test.module
index 9baf8ab4d46aaf4d3ad0b2c113a6e431ed4797d0..5f3d19d0333feee547229befc1cf0cc86dcefdb2 100644 (file)
@@ -5,15 +5,16 @@
  * Support module for user hooks testing.
  */
 
-use Drupal\Component\Utility\SafeMarkup;
+use Drupal\Component\Render\FormattableMarkup;
+use Drupal\Core\Session\AccountInterface;
 
 /**
  * Implements hook_user_format_name_alter().
  */
-function user_hooks_test_user_format_name_alter(&$name, $account) {
+function user_hooks_test_user_format_name_alter(&$name, AccountInterface $account) {
   if (\Drupal::state()->get('user_hooks_test_user_format_name_alter', FALSE)) {
     if (\Drupal::state()->get('user_hooks_test_user_format_name_alter_safe', FALSE)) {
-      $name = SafeMarkup::format('<em>@uid</em>', ['@uid' => $account->id()]);
+      $name = new FormattableMarkup('<em>@uid</em>', ['@uid' => $account->id()]);
     }
     else {
       $name = '<em>' . $account->id() . '</em>';