Skip to content

feat: Discourage assert(Not)Empty if "empty" usage is disallowed - #325

Open
mitelg wants to merge 1 commit into
phpstan:2.0.xfrom
mitelg:feat/dissallow-assert-empty
Open

feat: Discourage assert(Not)Empty if "empty" usage is disallowed#325
mitelg wants to merge 1 commit into
phpstan:2.0.xfrom
mitelg:feat/dissallow-assert-empty

Conversation

@mitelg

@mitelg mitelg commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

fixes: #270

Hey,

first attempt to fix the linked issue. I used Codex for that and I hope it did the job correct 😁 Tests are looking fine for me.

Happy to get some feedback 🤝

Best regards 👋

@mitelg
mitelg force-pushed the feat/dissallow-assert-empty branch from 7aaebe3 to 410764b Compare August 21, 2026 09:40
@mitelg
mitelg force-pushed the feat/dissallow-assert-empty branch from 410764b to 927cf58 Compare August 21, 2026 09:45
Comment thread rules.neon
PHPStan\Rules\PHPUnit\AssertEqualsIsDiscouragedRule:
phpstan.rules.rule: [%strictRulesInstalled%, %featureToggles.bleedingEdge%]
PHPStan\Rules\PHPUnit\AssertEmptyIsDiscouragedRule:
phpstan.rules.rule: %strictRulesInstalled%

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to bind it to the %strictRules.disallowedEmpty% toggle as well, but seems not be possible 🤔

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disallow assertEmpty with strict rule disallowedEmpty set

1 participant