<?php

namespace common\components;

use Faker\Factory;
use Faker\Generator;
use Faker\Provider\fr_FR\Address;
use Faker\Provider\fr_FR\Person;
use Faker\Provider\fr_FR\PhoneNumber;

class Faker
{
    protected Generator $faker;

    public function __construct()
    {
        $this->faker = Factory::create();
        $this->faker->addProvider(new Person($this->faker));
        $this->faker->addProvider(new PhoneNumber($this->faker));
        $this->faker->addProvider(new Address($this->faker));
    }

    public function name(): string
    {
        return $this->faker->name;
    }

    public function email(): string
    {
        return $this->faker->email;
    }

    public function phoneNumber(): string
    {
        return $this->faker->mobileNumber;
    }

    public function address(): string
    {
        return $this->faker->address;
    }
}