Should literal strings be a non-empty-string?
The problem I occurred is the following:
/**
* @return list<non-empty-string>
*/
function a(): array
{
// Imaging I have an external declared type like this:
/** @var array{foo?: list<non-empty-string>} $array */
$array = [];
return $array['foo'] ?? ['bar'];
}
https://psalm.dev/r/0cb0b9aa53
Should literal strings be a
non-empty-string?The problem I occurred is the following:
https://psalm.dev/r/0cb0b9aa53