nadyita/phpstan-amp-file-rule

A PHPStan rule to detect the use of sync filesystem calls for which there are async counterparts. Must be used in conjunction with amphp/file

Installs: 43

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:phpstan-extension

1.0.1 2024-04-28 11:19 UTC

This package is auto-updated.

Last update: 2024-04-28 11:20:19 UTC


README

amphp/file provides a set of async filesystem functions that don't block. If you're using the amp framework, you want to eliminate calls to blocking PHP functions as much as possible.

This PHPStan rule will help you detect calls to blocking PHP functions and will propose replacement functions from amphp/file instead. Use this rule to ensure that you don't have any blocking filesystem calls in your code.

Usage

Add the package to your repository with composer require --dev nadyita/phpstan-amp-file-rule.

Edit your project's phpstan.neon file and add this rule:

includes:
    - vendor/nadyita/phpstan-amp-file-rule/phpstan-amp-file-rule.neon