Psalm
Get started
Documentation
Paid support
Plugins
Blog
GitHub
<?php /** @var string $str */; if (isNonEmptyString($str)) { /** @psalm-check-type-exact $str = non-empty-string */; } else { /** @psalm-check-type-exact $str = string */; } /** * @psalm-assert-if-true non-empty-string $str */ function isNonEmptyString(string $str): bool { return true; }
Snippet created on May 4 2023 at 12:36 UTC
Settings
Get link