The tool rector has a configuration option for certain rules called TREAT_AS_NON_EMPTY. For example, https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#disallowedemptyrulefixerrector
What does this configuration actually do?
Depending on which rules you use this setting for, it performs any of the following refactors:
The general idea is that it replaces implicit conversions of types to booleans with explicit comparisons with the empty value.
The first transformation also avoids treating an empty string as falsey. The assumption being that when you declare the variable's type as
string|null, you didn't intend for an empty string to be treated equivalent tonull.