Skip to content

v1.2.0

Latest

Choose a tag to compare

@awcodes awcodes released this 23 Sep 19:31
· 17 commits to 1.x since this release
4ff51e7

What's changed

Seeded output is now fully reproducible

Seeding Faker now reproduces the output exactly, including where inline decorations (bold, italic, code, links) land. Before this release, decoration positions used random_int(), which ignored the seed. (#8)

fake()->seed(1234);

markdown_faker()->docsPage()->render(); // identical on every run

Bring your own Faker generator

make(), the helpers and a new fluent withFaker() method accept a Faker\Generator. You can use this, for example, to add your own providers:

MarkdownFaker::make($faker)->article()->render();
markdown_faker($faker)->article()->render();
MarkdownFaker::make()->withFaker($faker)->article()->render();

Existing calls are unaffected.

Notes

  • Faker's seed() seeds PHP's process-wide random generator, so seeding any Faker instance affects all of them. Seed immediately before generating the content you want to reproduce.
  • Generated prose comes from Faker's Lorem provider, which no locale overrides. A locale-specific generator still produces Latin text; to change the prose, add a provider that extends Faker\Provider\Lorem with your own $wordList (see the README for an example). Overriding individual methods such as paragraph() isn't enough, because Lorem calls its own methods internally.

Full Changelog: v1.1.0...v1.2.0