{"id":13622679,"url":"https://github.com/fakerphp/faker","last_synced_at":"2025-10-05T18:31:10.185Z","repository":{"id":37086442,"uuid":"307658860","full_name":"FakerPHP/Faker","owner":"FakerPHP","description":"Faker is a PHP library that generates fake data for you","archived":false,"fork":true,"pushed_at":"2025-01-01T20:57:39.000Z","size":10908,"stargazers_count":3665,"open_issues_count":50,"forks_count":361,"subscribers_count":25,"default_branch":"2.0","last_synced_at":"2025-01-15T07:03:12.088Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fakerphp.github.io","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fzaninotto/Faker","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FakerPHP.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null}},"created_at":"2020-10-27T10:10:59.000Z","updated_at":"2025-01-14T12:22:28.000Z","dependencies_parsed_at":"2023-09-22T12:26:48.436Z","dependency_job_id":"cd7fb164-2b7b-4ba3-8aea-04dac3d630af","html_url":"https://github.com/FakerPHP/Faker","commit_stats":{"total_commits":2300,"total_committers":600,"mean_commits":"3.8333333333333335","dds":0.8826086956521739,"last_synced_commit":"1a735f050e3246fadccdf8f684122b1f97e4bddb"},"previous_names":[],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FakerPHP%2FFaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FakerPHP%2FFaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FakerPHP%2FFaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FakerPHP%2FFaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FakerPHP","download_url":"https://codeload.github.com/FakerPHP/Faker/tar.gz/refs/heads/2.0","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235432153,"owners_count":18989467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T21:01:22.618Z","updated_at":"2025-10-05T18:31:03.819Z","avatar_url":"https://github.com/FakerPHP.png","language":"PHP","readme":"\u003cp style=\"text-align: center\"\u003e\u003cimg src=\"https://github.com/FakerPHP/Artwork/raw/main/src/socialcard.png\" alt=\"Social card of FakerPHP\"\u003e\u003c/p\u003e\n\n# Faker\n\n[![Packagist Downloads](https://img.shields.io/packagist/dm/FakerPHP/Faker)](https://packagist.org/packages/fakerphp/faker)\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/FakerPHP/Faker/tests.yaml?branch=2.0)](https://github.com/FakerPHP/Faker/actions)\n[![Type Coverage](https://shepherd.dev/github/FakerPHP/Faker/coverage.svg)](https://shepherd.dev/github/FakerPHP/Faker)\n[![Code Coverage](https://codecov.io/gh/FakerPHP/Faker/branch/main/graph/badge.svg)](https://codecov.io/gh/FakerPHP/Faker)\n\nFaker 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.\n\nIt's heavily inspired by Perl's [Data::Faker](https://metacpan.org/pod/Data::Faker), and by Ruby's [Faker](https://rubygems.org/gems/faker).\n\n## Getting Started\n\n### Installation\n\nFaker requires PHP \u003e= 7.4.\n\n```shell\ncomposer require fakerphp/faker\n```\n\n### Documentation\n\nFull documentation can be found over on [fakerphp.github.io](https://fakerphp.github.io).\n\n### Basic Usage\n\nUse `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.\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nrequire_once 'vendor/autoload.php';\n\n// use the factory to create a Faker\\Generator instance\n$faker = Faker\\Factory::create();\n// generate data by calling methods\necho $faker-\u003ename();\n// 'Vince Sporer'\necho $faker-\u003eemail();\n// 'walter.sophia@hotmail.com'\necho $faker-\u003etext();\n// 'Numquam ut mollitia at consequuntur inventore dolorem.'\n```\n\nEach call to `$faker-\u003ename()` yields a different (random) result. This is because Faker uses `__call()` magic, and forwards `Faker\\Generator-\u003e$method()` calls to `Faker\\Generator-\u003eformat($method, $attributes)`.\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nfor ($i = 0; $i \u003c 3; $i++) {\n    echo $faker-\u003ename() . \"\\n\";\n}\n\n// 'Cyrus Boyle'\n// 'Alena Cummerata'\n// 'Orlo Bergstrom'\n```\n\n## Automated refactoring\n\nIf you already used this library with its properties, they are now deprecated and needs to be replaced by their equivalent methods.\n\nYou can use the provided [Rector](https://github.com/rectorphp/rector) config file to automate the work.\n\nRun\n\n```bash\ncomposer require --dev rector/rector\n```\n\nto install `rector/rector`.\n\nRun\n\n```bash\nvendor/bin/rector process src/ --config vendor/fakerphp/faker/rector-migrate.php\n```\n\nto run `rector/rector`.\n\n*Note:* do not forget to replace `src/` with the path to your source directory.\n\nAlternatively, import the configuration in your `rector.php` file:\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Rector\\Config;\n\nreturn static function (Config\\RectorConfig $rectorConfig): void {\n    $rectorConfig-\u003eimport('vendor/fakerphp/faker/rector-migrate.php');\n};\n```\n\n## License\n\nFaker is released under the MIT License. See [`LICENSE`](LICENSE) for details.\n\n## PHP Version Support Policy\n\nThe maintainers of this package add support for a PHP version following its initial release and drop support for a PHP version one year after it has reached its end of security support.\n\n## Backward compatibility promise\n\nFaker is using [Semver](https://semver.org/). This means that versions are tagged\nwith MAJOR.MINOR.PATCH. Only a new major version will be allowed to break backward\ncompatibility (BC).\n\nClasses marked as `@experimental` or `@internal` are not included in our backward compatibility promise.\nYou are also not guaranteed that the value returned from a method is always the\nsame. You are guaranteed that the data type will not change.\n\nPHP 8 introduced [named arguments](https://wiki.php.net/rfc/named_params), which\nincreased the cost and reduces flexibility for package maintainers. The names of the\narguments for methods in Faker is not included in our BC promise.\n","funding_links":[],"categories":["Table of Contents","PHP","目录"],"sub_categories":["Testing","测试 Testing"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakerphp%2Ffaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffakerphp%2Ffaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffakerphp%2Ffaker/lists"}