PHPackages                             swisnl/phpstan-faker - 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. swisnl/phpstan-faker

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

swisnl/phpstan-faker
====================

PHPStan Reflection extension for custom Faker providers

1.1.0(1y ago)4386.3k↓48.8%[2 issues](https://github.com/swisnl/phpstan-faker/issues)MITPHPPHP ^7.4|^8.0CI passing

Since Aug 22Pushed 1y ago1 watchersCompare

[ Source](https://github.com/swisnl/phpstan-faker)[ Packagist](https://packagist.org/packages/swisnl/phpstan-faker)[ Docs](https://github.com/swisnl/phpstan-faker)[ RSS](/packages/swisnl-phpstan-faker/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

PHPStan Faker Provider Extension
================================

[](#phpstan-faker-provider-extension)

[![Latest Version on Packagist](https://camo.githubusercontent.com/95f45bfae5e4c53e3700e172f0fa619807aeab282d0b3108907d66bf73c82866/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737769736e6c2f7068707374616e2d66616b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swisnl/phpstan-faker)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Buy us a tree](https://camo.githubusercontent.com/cec0a9b35a1c3235bdbe0d13ea8fbd866a23e30280ad6ca27078c1fd4ac1b709/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d6c69676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://plant.treeware.earth/swisnl/phpstan-faker)[![Total Downloads](https://camo.githubusercontent.com/cb97465836bae34fafdf16a0dd6de5ef1d1de946f5cdc79617123cd6c0a383a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737769736e6c2f7068707374616e2d66616b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/swisnl/phpstan-faker)[![Maintained by SWIS](https://camo.githubusercontent.com/af0a8c6f2ea8b54aca03b7ca581e67c034ad17066e75fffeb068e8d5341bbae1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2546302539462539412538302d6d61696e7461696e65642532306279253230535749532d2532333037333741392e7376673f7374796c653d666c61742d737175617265)](https://www.swis.nl)

This PHPStan Reflection Extension can automatically register the methods and properties created by custom Faker providers, so you don't need to instruct PHPStan to ignore the usage of those methods.

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

[](#installation)

Via Composer

```
composer require --dev swisnl/phpstan-faker
```

If you also have [phpstan/extension-installer](https://github.com/phpstan/extension-installer) installed, then you don't need to follow the instructions for manual installation. Regardless of the installation method, you need to follow the instructions for configuration.

 Manual installationIf you don't want to use `phpstan/extension-installer`, include extension.neon in your project's PHPStan config:

```
includes:
    - vendor/swisnl/phpstan-faker/extension.neon
```

Configuration
-------------

[](#configuration)

Add the custom faker provider classes to the extension configuration.

```
parameters:
    faker:
        providerClasses:
            - App\Faker\MyProvider
```

**This does not actually register the custom providers in Faker, this just tells PHPStan about the custom providers.**

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

This package is [Treeware](https://treeware.earth). If you use it in production, then we ask that you [**buy the world a tree**](https://plant.treeware.earth/swisnl/phpstan-faker) to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

SWIS ❤️ Open Source
-------------------

[](#swis-heart-open-source)

[SWIS](https://www.swis.nl) is a web agency from Leiden, the Netherlands. We love working with open source software.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~470 days

Total

2

Last Release

551d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8734305?v=4)[SWIS](/maintainers/swisnl)[@swisnl](https://github.com/swisnl)

---

Top Contributors

[![rolfvandekrol](https://avatars.githubusercontent.com/u/434397?v=4)](https://github.com/rolfvandekrol "rolfvandekrol (3 commits)")[![bbrala](https://avatars.githubusercontent.com/u/3294970?v=4)](https://github.com/bbrala "bbrala (2 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (1 commits)")

---

Tags

testingPHPStanfakerreflection

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/swisnl-phpstan-faker/health.svg)

```
[![Health](https://phpackages.com/badges/swisnl-phpstan-faker/health.svg)](https://phpackages.com/packages/swisnl-phpstan-faker)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[shipmonk/dead-code-detector

Dead code detector to find unused PHP code via PHPStan extension. Can automatically remove dead PHP code. Supports libraries like Symfony, Doctrine, PHPUnit etc. Detects dead cycles. Can detect dead code that is tested.

4753.1M82](/packages/shipmonk-dead-code-detector)[ekino/phpstan-banned-code

Detected banned code using PHPStan

2986.0M111](/packages/ekino-phpstan-banned-code)[shipmonk/phpstan-rules

Various extra strict PHPStan rules we found useful in ShipMonk.

1542.0M166](/packages/shipmonk-phpstan-rules)[mrpunyapal/peststan

PHPStan extension for Pest PHP testing framework

4649.8k17](/packages/mrpunyapal-peststan)[league/factory-muffin-faker

The goal of this package is to wrap faker to make it super easy to use with factory muffin.

4112.0M27](/packages/league-factory-muffin-faker)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
