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: 550
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:phpstan-extension
Requires
- php: ^8.1.17
- phpstan/phpstan: ^1.10
Requires (Dev)
- composer-phar/php-cs-fixer: ^3.51.0
- nadybot/nadystyle: ^1.0.0
- nikic/php-parser: ^4.13.0
- thecodingmachine/safe: ^1.0 || ^2.0
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