psalm
psalm copied to clipboard
Psalm not warning of possible uncaught exception
Example: https://psalm.dev/r/89df127ce8
I am new to using Psalm, is this not a feature of Psalm?
I found these snippets:
https://psalm.dev/r/89df127ce8
<?php
function testUsesFunctionWithException( int $var ) : int {
return testFunctionWithException( $var );
}
function testFunctionWithException( int $var ) : int {
if ( $var === 1 ) {
throw new \Exception( 'Is one' );
}
return 0;
}
testUsesFunctionWithException( 1 );
testUsesFunctionWithException( 0 );
testFunctionWithException( 1 );
Psalm output (using commit 16b24bd):
No issues!