You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disallow assertEmpty with strict rule disallowedEmpty set聽#270
I am currently trying to activate the disallowedEmpty rule of the strict package in our code base (over 1k issues 馃帀馃く馃檲)
While doing that, I found, that the usage of assertEmpty is not affected by this rule. Is this intentionally? Or do you think, it would be an addition that actually makes sense and would make it consistent?
Activity
staabm commentedon Dec 17, 2025
I agree and I think we are doing something similar with another rule already in
phpstan-phpunit/rules.neon
Lines 13 to 14 in 202afe9
I am not sure we can/should utilize the very fine grained
disallowedEmptythough.. maybestrictRulesInstalledis enoughondrejmirtes commentedon Dec 17, 2025
I'd like to check what assertEmpty actually does and if it's as bad as PHP's empty().
staabm commentedon Dec 17, 2025
see the implementation of IsEmpty
mitelg commentedon Mar 31, 2026
hey @ondrejmirtes @staabm
how can we proceed here? If you point me to the right direction, I can try to add this
feat: Discourage assert(Not)Empty if "empty" usage is disallowed
feat: Discourage assert(Not)Empty if "empty" usage is disallowed
feat: Discourage assert(Not)Empty if "empty" usage is disallowed
feat: Discourage assert(Not)Empty if "empty" usage is disallowed
feat: Discourage assert(Not)Empty if "empty" usage is disallowed