Skip to content

Conversation

@TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Mar 19, 2025

Ref: #456 (comment)

I'm looking into this rule once again, as it actually creates less readable code. We ignore it completely on couple of projects.
empty() is too vague structure and PHPStan and Rector rules try to refactor away form it.

Also in $this->assertCount(x, ...) is more readable in context of similar counter tests:

$this->assertCount(1, ...);
$this->assertCount(5, ...);
$this->assertCount(0, ...);

Saying that, I'll deprecate and remove this rule form the set, to promote higher quality code 👍

@TomasVotruba TomasVotruba changed the title tv count collection [deprecated] Deprecate AssertCountWithZeroToAssertEmptyRector to improve test readability with more explicit methods Mar 19, 2025
…ove test readability with more explicit methods
@TomasVotruba TomasVotruba merged commit 2ede549 into main Mar 19, 2025
6 checks passed
@TomasVotruba TomasVotruba deleted the tv-count-collection branch March 19, 2025 19:08
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.

2 participants