Skip to content

Commit e6e6a98

Browse files
committed
chore: add regression test for bug-10942
1 parent 745d02b commit e6e6a98

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,12 @@ public function testBug13714(): void
15771577
$this->assertSame('Function Bug13714\array_find invoked with 2 parameters, 0 required.', $errors[6]->getMessage());
15781578
}
15791579

1580+
public function testBug10942(): void
1581+
{
1582+
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-10942.php');
1583+
$this->assertNoErrors($errors);
1584+
}
1585+
15801586
/**
15811587
* @param string[]|null $allAnalysedFiles
15821588
* @return list<Error>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug10942;
4+
5+
class A
6+
{
7+
8+
/**
9+
* @param string|($operator is 'in' ? int : never) $sqlRight
10+
*/
11+
protected function _renderConditionBinary(string $operator, string $sqlLeft, $sqlRight): string
12+
{
13+
return 'x';
14+
}
15+
16+
}
17+
18+
class B extends A
19+
{
20+
21+
#[\Override]
22+
protected function _renderConditionBinary(string $operator, string $sqlLeft, $sqlRight): string
23+
{
24+
return 'y';
25+
}
26+
27+
}

0 commit comments

Comments
 (0)