phpstan-wordpress: `wp_die()` doesn't end script anymore

Hello,

Sorry to bring bad news. Unless I’m missing something, it seems that something went wrong with #201.

/**
 * @phpstan-return never
 */
function foo() {
	wp_die();
}

This ends with the following message:

Function foo() should always throw an exception or terminate script execution but doesn’t do that.

Versions used:

php-stubs/wordpress-stubs v6.3.2
szepeviktor/phpstan-wordpress v1.3.1

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Reactions: 1
  • Comments: 24 (21 by maintainers)

Most upvoted comments

WordPress will *NEVER* die()

@szepeviktor Sorry I should have mentioned that in the OP.

php-stubs/wordpress-stubs v6.3.2
szepeviktor/phpstan-wordpress v1.3.1

Looks like a test is needed for assertType('*NEVER*', wp_die('')); too (no second parameter).