phpstan beberlei assert
2.0.0
この拡張機能の主な範囲は、 AssertAssertion検証後にPHPSTANがオブジェクトのタイプを検出するのを支援することです。
<?php declare (strict_types = 1 );
use Assert Assertion ;
function demo (? int $ a ) {
// ...
Assertion:: integer ( $ a );
// PHPStan is now aware that $a can no longer be `null` at this point
return ( $ a === 10 );
}この拡張機能を使用するには、作曲家でそれを必要とします。
composer require --dev phpstan/phpstan-beberlei-assert
PHPSTAN/Extension-Installerもインストールする場合は、すべて設定されています。
phpstan/extension-installer使用したくない場合は、プロジェクトのphpstan configにextension.neonを含めます。
includes:
- vendor/phpstan/phpstan-beberlei-assert/extension.neon