Skip to content
Inspires some JSON data basing itself on a JSON schema
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Exception Remove loader from muse Mar 11, 2015
Generator Added supported for schema definition Mar 24, 2017
spec
.gitignore Fixed travis & updated gitignore Mar 11, 2015
.travis.yml
Generator.php Initial commit Mar 10, 2015
Loader.php
Muse.php
MuseFactory.php Introduce faker data provider Mar 17, 2015
README.md Fix typo in url Aug 30, 2015
composer.json Reverted to phpspec 2.1 (for php 5.4 support) Mar 24, 2017
phpspec.yml

README.md

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"
}
You can’t perform that action at this time.