knplabs/muse

This package is abandoned and no longer maintained. No replacement package was suggested.

2.0.0 2019-12-13 08:32 UTC

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

Build Status

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"
}