You are here

class FakerService in General Data Protection Regulation 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/anonymizer/src/Service/FakerService.php \Drupal\anonymizer\Service\FakerService
  2. 8 modules/anonymizer/src/Service/FakerService.php \Drupal\anonymizer\Service\FakerService

Class FakerService.

@package Drupal\anonymizer\Service

Hierarchy

Expanded class hierarchy of FakerService

1 string reference to 'FakerService'
anonymizer.services.yml in modules/anonymizer/anonymizer.services.yml
modules/anonymizer/anonymizer.services.yml
1 service uses FakerService
anonymizer.faker in modules/anonymizer/anonymizer.services.yml
Drupal\anonymizer\Service\FakerService

File

modules/anonymizer/src/Service/FakerService.php, line 12

Namespace

Drupal\anonymizer\Service
View source
class FakerService implements FakerServiceInterface {

  /**
   * The faker generator.
   *
   * @var \Faker\Generator
   */
  protected $generator;

  /**
   * FakerService constructor.
   */
  public function __construct() {
    $this->generator = Factory::create();
  }

  /**
   * Return the generator.
   *
   * @return \Faker\Generator
   *   The generator.
   */
  public function generator() {
    return $this->generator;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FakerService::$generator protected property The faker generator.
FakerService::generator public function Return the generator. Overrides FakerServiceInterface::generator
FakerService::__construct public function FakerService constructor.