swisnl / phpstan-faker
PHPStan Reflection extension for custom Faker providers
Installs: 64 504
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Type:phpstan-extension
Requires
- php: ^7.4|^8.0
- ext-json: *
- phpstan/phpstan: ^1.0
Requires (Dev)
- fakerphp/faker: ^1.21
- laravel/pint: ^1.2
This package is auto-updated.
Last update: 2024-10-22 11:34:02 UTC
README
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
Via Composer
composer require --dev swisnl/phpstan-faker
If you also have 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 installation
If 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
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
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree 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 is a web agency from Leiden, the Netherlands. We love working with open source software.