The is_non_empty_string() function currently follows PHP's default non-strict comparison logic. This means the string '0' evaluates as "empty".
This is not the intended behavior of is_non_empty_string(). It is intended to function as a type guard for PHPStan's non-empty-string type, which doesn't consider the string '0' to be empty.
The functions should be updated accordingly:
function is_non_empty_string(mixed $value): bool
{
return is_string($value) && $value !== '';
}
The
is_non_empty_string()function currently follows PHP's default non-strict comparison logic. This means the string'0'evaluates as "empty".This is not the intended behavior of
is_non_empty_string(). It is intended to function as a type guard for PHPStan'snon-empty-stringtype, which doesn't consider the string'0'to be empty.The functions should be updated accordingly: