knplabs / muse
Installs: 20 896
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 23
Forks: 2
Open Issues: 0
Requires
- php: ^7.2
- fzaninotto/faker: ^1.9
Requires (Dev)
- phpspec/phpspec: ^6.1
This package is auto-updated.
Last update: 2022-09-23 13:38:12 UTC
README
Unfortunately we decided to not maintain this project anymore (see why). If you want to mark another package as a replacement for this one please send an email to hello@knplabs.com.
Muse
The Muse inspires itself from a JSON Schema (only wth JSON Schema v4 for now) to generate a valid JSON.
Usage
$schema = <<<SCHEMA { "type": "object", "properties": { "id": { "type": "integer" }, "name": { "type": "string" } } } SCHEMA; echo "Dumb data provider\n"; echo \Muse\MuseFactory::createDumbMuse()->inspire($schema); echo "\n\n"; echo "Random data provider\n"; echo \Muse\MuseFactory::createRandomMuse()->inspire($schema);
will output:
Dumb data provider
{
"id": 1,
"name": "foo"
}
Random data provider
{
"id": 1634388030,
"name": "ajkvu5xpepkwwc04skkw4wgs0s4ok48"
}