Skip to content

Disallow assertEmpty with strict rule disallowedEmpty set聽#270

Closed

Description

@mitelg

hey there

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?

Happy to hear your feedback on this 馃檪

best regards 馃憢

Activity

  1. staabm commented on Dec 17, 2025

    @staabm
    Contributor

    I agree and I think we are doing something similar with another rule already in

    PHPStan\Rules\PHPUnit\AssertEqualsIsDiscouragedRule:
    phpstan.rules.rule: [%strictRulesInstalled%, %featureToggles.bleedingEdge%]

    I am not sure we can/should utilize the very fine grained disallowedEmpty though.. maybe strictRulesInstalled is enough

  2. ondrejmirtes commented on Dec 17, 2025

    @ondrejmirtes
    Member

    I'd like to check what assertEmpty actually does and if it's as bad as PHP's empty().

  3. staabm commented on Dec 17, 2025

    @staabm
    Contributor
  4. mitelg commented on Mar 31, 2026

    @mitelg
    ContributorAuthor

    hey @ondrejmirtes @staabm

    how can we proceed here? If you point me to the right direction, I can try to add this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions