/phpstan-stripe

Stripe SDK extension for PHPStan

Primary LanguagePHPMIT LicenseMIT

phpstan-stripe

Stripe SDK extension for PHPStan

PHP library for the Stripe API uses PHP objects where some of the properties are used only when the object is updated.

These are not documented using @property tags on the classes, and the dev team feels it should stay this way. Honestly, I'm not sure adding @property tags would be the best way either.

PHPStan will obviously flag such property access and this extension will resolve those errors by telling PHPStan such properties exist.

Installation

The package is hosted on Packagist so you can install it using Composer:

composer require --dev spaze/phpstan-stripe

Add this to your phpstan.neon:

includes:
    - vendor/spaze/phpstan-stripe/extension.neon