JsonapiTestUserHooks.php

Namespace

Drupal\jsonapi_test_user\Hook

File

core/modules/jsonapi/tests/modules/jsonapi_test_user/src/Hook/JsonapiTestUserHooks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\jsonapi_test_user\Hook;

use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for jsonapi_test_user.
 */
class JsonapiTestUserHooks {
    
    /**
     * Implements hook_user_format_name_alter().
     */
    public function userFormatNameAlter(&$name, AccountInterface $account) {
        if ($account->isAnonymous()) {
            $name = 'User ' . $account->id();
        }
    }

}

Classes

Title Deprecated Summary
JsonapiTestUserHooks Hook implementations for jsonapi_test_user.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.