PHP code example of anteris-dev / faker-map

1. Go to this page and download the library: Download anteris-dev/faker-map library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

anteris-dev / faker-map example snippets



use Anteris\FakerMap\FakerMap;
use Faker\Factory;

// FakerMap will handle creating a faker instance for you here.
$map = FakerMap::new();

// Or you can pass in your own instance. This is handy for seeding!
$faker = Factory::create();
$faker->seed(123);

$map = new FakerMap($faker);



FakerMap::new()->closeEnough('female name')->fake();

FakerMap::new()->closest('female name')->fake();

FakerMap::new()->guess('female name', 3)->fake();

// A guess that passes some parameters
// Returns: A number between 1 and 40
FakerMap::new()->closest('number between')->fake(1, 40);

// A guess that definitely won't have a match so it defaults to "Yikes!"
FakerMap::new()->closest('some unknown value')->default('Yikes!')->fake();

// Passes on to the underlying faker instance.
FakerMap::new()->faker()->firstNameFemale();



class Person {
	public string $firstName;
	public string $lastName;
	public string $companyName;
	public string $email;
	public string $address1;
	public string $address2;
	public string $socialSecurityNumber;
}