You are here

public function UsernameAnonymizer::anonymize in General Data Protection Regulation 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/anonymizer/src/Plugin/Anonymizer/UsernameAnonymizer.php \Drupal\anonymizer\Plugin\Anonymizer\UsernameAnonymizer::anonymize()
  2. 8 modules/anonymizer/src/Plugin/Anonymizer/UsernameAnonymizer.php \Drupal\anonymizer\Plugin\Anonymizer\UsernameAnonymizer::anonymize()

Throws

\RuntimeException

Overrides AnonymizerInterface::anonymize

File

modules/anonymizer/src/Plugin/Anonymizer/UsernameAnonymizer.php, line 26

Class

UsernameAnonymizer
Class UsernameAnonymizer.

Namespace

Drupal\anonymizer\Plugin\Anonymizer

Code

public function anonymize($input, FieldItemListInterface $field = NULL) {
  return $this->faker
    ->generator()
    ->unique()->userName;
}