phpstan beberlei assert
2.0.0
該擴展程序的主要範圍是幫助PHPSTAN在AssertAssertion驗證後檢測對象的類型。
<?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配置中包含Extension.Neon:
includes:
- vendor/phpstan/phpstan-beberlei-assert/extension.neon