You are here

UriAnonymizer.php in General Data Protection Regulation 3.0.x

File

modules/anonymizer/src/Plugin/Anonymizer/UriAnonymizer.php
View source
<?php

namespace Drupal\anonymizer\Plugin\Anonymizer;

use Drupal\anonymizer\Anonymizer\AnonymizerBase;
use Drupal\Core\Field\FieldItemListInterface;

/**
 * Class UriAnonymizer.
 *
 * @Anonymizer(
 *   id = "uri_anonymizer",
 *   label = @Translation("Uri anonymizer"),
 *   description = @Translation("Provides anonymization functionality for uri's")
 * )
 *
 * @package Drupal\anonymizer\Plugin\Anonymizer
 */
class UriAnonymizer extends AnonymizerBase {

  /**
   * {@inheritdoc}
   */
  public function anonymize($input, FieldItemListInterface $field = NULL) {

    // @todo Force https?
    return $this->faker
      ->generator()->url;
  }

}

Classes

Namesort descending Description
UriAnonymizer Class UriAnonymizer.