Skip to content

Commit e703755

Browse files
committed
remove artificial case of passing literal null to isNull
1 parent a54302d commit e703755

3 files changed

Lines changed: 0 additions & 7 deletions

File tree

‎src/Rules/PHPUnit/AssertEmptyIsDiscouragedRule.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ private function getReplacement(Type $type, bool $negated): ?array
9292
if ($type->isInteger()->yes()) {
9393
return [$negated ? 'assertNotSame' : 'assertSame', new Int_(0)];
9494
}
95-
if ($type->isNull()->yes()) {
96-
return [$negated ? 'assertNotNull' : 'assertNull', null];
97-
}
9895
if ($type->isNonFalsyString()->yes()) {
9996
return [$negated ? 'assertNotSame' : 'assertSame', new String_('')];
10097
}

‎tests/Rules/PHPUnit/data/assert-empty-is-discouraged-fixable.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public function test(
3434
$this->assertNotEmpty($integer);
3535
Assert::assertEmpty($float);
3636
Assert::assertNotEmpty($float);
37-
static::assertEmpty(null);
38-
static::assertNotEmpty(null);
3937
$this->assertEmpty($nonFalsyString);
4038
$this->assertNotEmpty($otherNonFalsyString);
4139
$this->assertEmpty($string);

‎tests/Rules/PHPUnit/data/assert-empty-is-discouraged-fixable.php.fixed‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ final class AssertEmptyTest extends TestCase
3434
$this->assertNotSame(0, $integer);
3535
Assert::assertEmpty($float);
3636
Assert::assertNotEmpty($float);
37-
static::assertNull(null);
38-
static::assertNotNull(null);
3937
$this->assertSame('', $nonFalsyString);
4038
$this->assertNotSame('', $otherNonFalsyString);
4139
$this->assertEmpty($string);

0 commit comments

Comments
 (0)