UsernameAnonymizer.php in General Data Protection Regulation 8.2
Same filename and directory in other branches
Namespace
Drupal\anonymizer\Plugin\AnonymizerFile
modules/anonymizer/src/Plugin/Anonymizer/UsernameAnonymizer.phpView source
<?php
namespace Drupal\anonymizer\Plugin\Anonymizer;
use Drupal\anonymizer\Anonymizer\AnonymizerBase;
use Drupal\Core\Field\FieldItemListInterface;
/**
* Class UsernameAnonymizer.
*
* @Anonymizer(
* id = "username_anonymizer",
* label = @Translation("Username anonymizer"),
* description = @Translation("Provides anonymization functionality intended to be used for user names.")
* )
*
* @package Drupal\anonymizer\Plugin\Anonymizer
*/
class UsernameAnonymizer extends AnonymizerBase {
/**
* {@inheritdoc}
*
* @throws \RuntimeException
*/
public function anonymize($input, FieldItemListInterface $field = NULL) {
return $this->faker
->generator()
->unique()->userName;
}
}
Classes
Name | Description |
---|---|
UsernameAnonymizer | Class UsernameAnonymizer. |