Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/PHPStan/Analyser/AnalyserIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,12 @@ public function testBug13714(): void
$this->assertSame('Function Bug13714\array_find invoked with 2 parameters, 0 required.', $errors[6]->getMessage());
}

public function testBug10942(): void
{
$errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-10942.php');
$this->assertNoErrors($errors);
}

/**
* @param string[]|null $allAnalysedFiles
* @return list<Error>
Expand Down
27 changes: 27 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-10942.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php declare(strict_types = 1);

namespace Bug10942;

class A
{

/**
* @param string|($operator is 'in' ? int : never) $sqlRight
*/
protected function _renderConditionBinary(string $operator, string $sqlLeft, $sqlRight): string
{
return 'x';
}

}

class B extends A
{

#[\Override]
protected function _renderConditionBinary(string $operator, string $sqlLeft, $sqlRight): string
{
return 'y';
}

}
Loading