Skip to content

Commit 472feeb

Browse files
committed
Regression test
1 parent ab5c217 commit 472feeb

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,4 +549,10 @@ public function testTentativeReturnTypes(int $phpVersionId, array $errors): void
549549
$this->analyse([__DIR__ . '/data/tentative-return-types.php'], $errors);
550550
}
551551

552+
public function testCountableBug(): void
553+
{
554+
$this->phpVersionId = PHP_VERSION_ID;
555+
$this->analyse([__DIR__ . '/data/countable-bug.php'], []);
556+
}
557+
552558
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace CountableBug;
4+
5+
class Foo implements \Countable
6+
{
7+
/**
8+
* Returns the number of packages in this repository
9+
*
10+
* @return int Number of packages
11+
*/
12+
public function count()
13+
{
14+
return 1;
15+
}
16+
}

0 commit comments

Comments
 (0)