Skip to content

Commit

Permalink
Merge pull request #4 from ryakoviv/add-support-const
Browse files Browse the repository at this point in the history
Add support of constants values
  • Loading branch information
koriym authored Oct 16, 2019
2 parents c50cfbf + c88d631 commit dc41636
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Faker.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public function generate($schema, \stdClass $parentSchema = null, string $schema
return Base::randomElement($schema->enum);
}

if (isset($schema->const)) {
return Base::randomElement([$schema->const]);
}

if (! isset($this->fakers[$type])) {
throw new UnsupportedTypeException($type);
}
Expand Down

0 comments on commit dc41636

Please # to comment.