localheinz/faker-provider

Provides additional providers for fzaninotto/faker.

0.1.0 2019-05-21 07:13 UTC

README

Build Status codecov Latest Stable Version Total Downloads

Provides additional providers for fzaninotto/faker.

Installation

Run

$ composer require --dev localheinz/faker-provider

Usage

First obtain an instance of Faker\Generator:

use Faker\Factory;

$faker = Factory::create();

Then add providers like this:

use Localheinz\Faker\Provider;

$faker->addProvider(new Provider\AvatarUrlProvider($faker));

Providers

This package provides the following providers for use with fzaninotto/faker:

AvatarUrlProvider

use Faker\Generator;
use Localheinz\Faker\Provider;

/** @var Generator&Provider\AvatarUrlProvider $faker */
$url = $faker->adorableAvatarUrl();

$urlWithFixedIdentifier = $faker->adorableAvatarUrl('localheinz');

$urlWithFixedIdentifierAndSize = $faker->adorableAvatarUrl(
    'localheinz',
    150
);

Example of avatars.adorable.io avatar

Also see avatars.adorable.io.

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md.

License

This package is licensed using the MIT License.