Coder Social home page Coder Social logo

magicianred / faker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fakerphp/faker

1.0 0.0 0.0 9.66 MB

Faker is a PHP library that generates fake data for you

Home Page: https://fakerphp.github.io

License: MIT License

Makefile 0.01% PHP 99.99%

faker's Introduction

Social card of FakerPHP

Faker

Packagist Downloads GitHub Workflow Status Type Coverage Code Coverage

Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.

It's heavily inspired by Perl's Data::Faker, and by Ruby's Faker.

Getting Started

Installation

Faker requires PHP >= 7.1.

composer require fakerphp/faker

Documentation

Full documentation can be found over on fakerphp.github.io.

Basic Usage

Use Faker\Factory::create() to create and initialize a Faker generator, which can generate data by accessing methods named after the type of data you want.

<?php
require_once 'vendor/autoload.php';

// use the factory to create a Faker\Generator instance
$faker = Faker\Factory::create();
// generate data by calling methods
echo $faker->name();
// 'Vince Sporer'
echo $faker->email();
// '[email protected]'
echo $faker->text();
// 'Numquam ut mollitia at consequuntur inventore dolorem.'

Each call to $faker->name() yields a different (random) result. This is because Faker uses __call() magic, and forwards Faker\Generator->$method() calls to Faker\Generator->format($method, $attributes).

<?php
for ($i = 0; $i < 3; $i++) {
    echo $faker->name() . "\n";
}

// 'Cyrus Boyle'
// 'Alena Cummerata'
// 'Orlo Bergstrom'

License

Faker is released under the MIT License. See LICENSE for details.

Backward compatibility promise

Faker is using Semver. This means that versions are tagged with MAJOR.MINOR.PATCH. Only a new major version will be allowed to break backward compatibility (BC).

Classes marked as @experimental or @internal are not included in our backward compatibility promise. You are also not guaranteed that the value returned from a method is always the same. You are guaranteed that the data type will not change.

PHP 8 introduced named arguments, which increased the cost and reduces flexibility for package maintainers. The names of the arguments for methods in Faker is not included in our BC promise.

faker's People

Contributors

ankitpokhrel avatar applestump avatar bazo avatar bessl avatar bram-pkg avatar browner12 avatar carusogabriel avatar dependabot[bot] avatar dynom avatar fzaninotto avatar grahamcampbell avatar igorsantos07 avatar ionbazan avatar jremes-foss avatar krsriq avatar localheinz avatar nineinchnick avatar nyholm avatar oittaa avatar okj579 avatar pimjansen avatar pomaxa avatar ppelgrims avatar ronanguilloux avatar tharoldd avatar timwolla avatar tzhuan avatar vlakoff avatar yerlenzhubangaliyev avatar zachflower avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.