PHPackages                             calebdw/fakerstan - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. calebdw/fakerstan

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

calebdw/fakerstan
=================

PHPStan extension for Faker

v1.2.0(6mo ago)371.6k—0.6%12MITPHPPHP ^8.2CI passing

Since Dec 19Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/calebdw/fakerstan)[ Packagist](https://packagist.org/packages/calebdw/fakerstan)[ Docs](https://github.com/calebdw/fakerstan)[ GitHub Sponsors](https://github.com/calebdw)[ RSS](/packages/calebdw-fakerstan/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (2)

 [![FakerStan](/art/fakerstan.webp)](/art/fakerstan.webp)

A [PHPStan](https://phpstan.org) extension for [Faker](https://fakerphp.org/).

 [![Test Results](https://github.com/calebdw/fakerstan/actions/workflows/tests.yml/badge.svg)](https://github.com/calebdw/fakerstan/actions/workflows/tests.yml) [![License](https://camo.githubusercontent.com/1da2ad1485140e439215f8c05f8987460e32c64dec75521e8c93fad704ce1476/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63616c656264772f66616b65727374616e)](https://github.com/calebdw/fakerstan) [![Packagist Version](https://camo.githubusercontent.com/c224872a06663cd9757d0b0c469228697ea74e6940b8e9925ce84918476d126b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63616c656264772f66616b65727374616e2e737667)](https://packagist.org/packages/calebdw/fakerstan) [![Total Downloads](https://camo.githubusercontent.com/2e2c4339afb6c2880b79ee2b7c5eebe901a7dd6d155551f4f8150c955c988479/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616c656264772f66616b65727374616e2e737667)](https://packagist.org/packages/calebdw/fakerstan)

Install
-------

[](#install)

```
composer require calebdw/fakerstan --dev
```

If you have the [PHPStan extension installer](https://phpstan.org/user-guide/extension-library#installing-extensions) installed then nothing more is needed, otherwise you will need to manually include the extension in the `phpstan.neon(.dist)` configuration file:

```
includes:
    - ./vendor/calebdw/fakerstan/extension.neon
```

Features
--------

[](#features)

### Custom Providers

[](#custom-providers)

FakerStan will automatically look for unknown methods on the custom providers on the Faker instance and infer the return type based on the method signature, even generics are supported:

```
