PHPackages                             loophp/typed-generators - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. loophp/typed-generators

ActiveLibrary

loophp/typed-generators
=======================

Generate random typed values and in any shape.

53[1 issues](https://github.com/loophp/typed-generators/issues)[11 PRs](https://github.com/loophp/typed-generators/pulls)PHPCI passing

Since Jun 10Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/loophp/typed-generators)[ Packagist](https://packagist.org/packages/loophp/typed-generators)[ RSS](/packages/loophp-typed-generators/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (14)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/248817228b4aa28df788b5d0e62c012abe88312457642d4dd17d6d386e9e6e4a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f6f7068702f74797065642d67656e657261746f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/typed-generators)[![GitHub stars](https://camo.githubusercontent.com/5850d5bce8bb244d67c7d951ade49c5e6ea37c87eadf555c4e98186f673bb387/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6c6f6f7068702f74797065642d67656e657261746f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/typed-generators)[![Total Downloads](https://camo.githubusercontent.com/dda8cbd48d3be55d362acd6a6e42df0e86ffa98682d36b41a96f736baabc727e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6f6f7068702f74797065642d67656e657261746f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/typed-generators)[![GitHub Workflow Status](https://camo.githubusercontent.com/26c64d58925a6b5f9dd2109756851dc06defcb2147adc8d194eb1bac9cd9c57d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6c6f6f7068702f74797065642d67656e657261746f72732f556e697425323074657374733f7374796c653d666c61742d737175617265)](https://github.com/loophp/typed-generators/actions)[![Scrutinizer code quality](https://camo.githubusercontent.com/25a7814983df8f369dbd2746c330a70b550fe606a03845201c9dc65443deab53/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f6c6f6f7068702f74797065642d67656e657261746f72732f6d61696e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/loophp/typed-generators/?branch=main)[![Type Coverage](https://camo.githubusercontent.com/890fca4ad711082bb3ebccec11f09f516d926cd6871bc4b6f55aaf0cd9bf4e51/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f6a736f6e3f7374796c653d666c61742d73717561726526636f6c6f723d636f6c6f72266c6162656c3d54797065253230636f7665726167652671756572793d6d6573736167652675726c3d687474707325334125324625324673686570686572642e6465762532466769746875622532466c6f6f7068702532466974657261746f7273253246636f766572616765)](https://shepherd.dev/github/loophp/typed-generators)[![Code Coverage](https://camo.githubusercontent.com/35fac75c0635d680aa3cf325909988fc0bf845883b643c790fe5d7f8d5b48acc/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c6f6f7068702f74797065642d67656e657261746f72732f6d61696e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/loophp/typed-generators/?branch=main)[![Mutation testing badge](https://camo.githubusercontent.com/f7e1558c6ccb41b353b8c0ab490b7c54502359f502727b6d1c0eca472436950b/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d2532466c6f6f70687025324674797065642d67656e657261746f72732532466d61696e)](https://dashboard.stryker-mutator.io/reports/github.com/loophp/typed-generators/main)[![License](https://camo.githubusercontent.com/82fb99fff6346acd73f53c264494a45ca93dd434650c4866d518073eb470bbb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f6f7068702f74797065642d67656e657261746f72732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/loophp/typed-generators)[![Donate!](https://camo.githubusercontent.com/a71f45de7e408be2477113d166e9ee94c90bbf814a1373fd154aa5b6652302de/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53706f6e736f722d4769746875622d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/sponsors/drupol)

PHP Typed Generators
====================

[](#php-typed-generators)

Description
-----------

[](#description)

Generate random typed values and in any shape.

Useful for writing your tests, there's no need to write static set of typed values, you can now generate them using this tool.

Each generated random values or shape is fully typed and can safely be used by existing static analysis tools such as PHPStan or PSalm.

Installation
------------

[](#installation)

`composer require loophp/typed-generators`

Usage
-----

[](#usage)

This library has a single entry point class factory. By using a single factory class, the user is able to quickly instantiate objects and use auto-completion.

Find the complete API directly in the [`TG` class](https://github.com/loophp/typed-generators/blob/main/src/TG.php).

### Quick API overview

[](#quick-api-overview)

```
