Skip to content

Commit

Permalink
Add test to avoid regression
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and ondrejmirtes committed Dec 30, 2019
1 parent 7d23f5e commit 7450126
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/PHPStan/Rules/Comparison/data/strict-comparison.php
Original file line number Diff line number Diff line change
Expand Up @@ -935,3 +935,17 @@ private function returnsVoid(): void
}

}

abstract class RandomAbstractClass {}

class AvoidRegressionBecauseThisWasReturningAnErrorInPhpstan11_5
{
private const MAPPING = [\stdClass::class, RandomAbstractClass::class];

public function test(int $key)
{
if (is_subclass_of(self::MAPPING[$key], RandomAbstractClass::class) === false) {
return;
}
}
}

0 comments on commit 7450126

Please sign in to comment.