Skip to content

Car, and car related data generation using fzaninotto/Faker

License

Notifications You must be signed in to change notification settings

ppelgrims/FakerCar

Repository files navigation

Build Status

FakerCar

Car related data generation using fzaninotto/Faker

Installation

Add the FakerCar library to your composer.json file:

$ composer require ppelgrims/faker-car

Usage

<?php

$faker = \Faker\Factory::create();
$faker->addProvider(new \FakerCar\Provider\Car($faker));
$faker->addProvider(new \FakerCar\Provider\Color($faker));

// Generator
$faker->torque();        // 305 Nm
$faker->carModelName();  // A4
$faker->carColor();      // Frosty Black

Formatters

FakerCar\Provider\Car

carBrandName()      // Audi
carModelName()      // Golf GTi
power()             // 65 Nm
torque()            // 65 kW
engineCapacity()    // 1.8 L
vin($year = 1980)   // 5GZCZ43D13S812715
fuelType()          // Hybrid
marketSegmentName() // F-segment luxery cars

FakerCar\Provider\Color

carColor            // Frosty Black

Localization

FakerCar\Provider\de_DE\Car

carBrandName()      // Volkswagen

FakerCar\Provider\fr_FR\Car

carBrandName()      // Renault

FakerCar\Provider\en_GB\Car

carBrandName()      // Jaguar
marketSegmentName() // Executive car

FakerCar\Provider\en_US\Car

carBrandName()      // Cadillac
power()             // 65 HP
torque()            // 65 lb-ft
marketSegmentName() // Full-size SUV

Tests

$ make sniff test

Contributing

Please see contributing for details.

License

The MIT License (MIT). Please see License File for more information.

About

Car, and car related data generation using fzaninotto/Faker

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published