Skip to content

Commit 59c672f

Browse files
committed
fix build
1 parent a5e22f3 commit 59c672f

13 files changed

+34
-10
lines changed

src/Reflection/BetterReflection/SourceLocator/FileReadTrapStreamWrapper.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ public function stream_eof(): bool
212212
return $this->readFromFile;
213213
}
214214

215+
/**
216+
* @return true
217+
*/
215218
public function stream_flush(): bool
216219
{
217220
return true;
@@ -254,6 +257,8 @@ public function stream_seek($offset, $whence): bool
254257
* @param int $option
255258
* @param int $arg1
256259
* @param int $arg2
260+
*
261+
* @return false
257262
*/
258263
public function stream_set_option($option, $arg1, $arg2): bool
259264
{

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,15 +1098,23 @@ public function testBug8376(): void
10981098
public function testAssertDocblock(): void
10991099
{
11001100
$errors = $this->runAnalyse(__DIR__ . '/nsrt/assert-docblock.php');
1101-
$this->assertCount(4, $errors);
1102-
$this->assertSame('Call to method AssertDocblock\A::testInt() with string will always evaluate to false.', $errors[0]->getMessage());
1103-
$this->assertSame(218, $errors[0]->getLine());
1104-
$this->assertSame('Call to method AssertDocblock\A::testNotInt() with string will always evaluate to true.', $errors[1]->getMessage());
1105-
$this->assertSame(224, $errors[1]->getLine());
1106-
$this->assertSame('Call to method AssertDocblock\A::testInt() with int will always evaluate to true.', $errors[2]->getMessage());
1107-
$this->assertSame(232, $errors[2]->getLine());
1108-
$this->assertSame('Call to method AssertDocblock\A::testNotInt() with int will always evaluate to false.', $errors[3]->getMessage());
1109-
$this->assertSame(238, $errors[3]->getLine());
1101+
$this->assertCount(8, $errors);
1102+
$this->assertSame('Function AssertDocblock\validateStringArrayIfTrue() never returns false so it can be removed from the return type.', $errors[0]->getMessage());
1103+
$this->assertSame(17, $errors[0]->getLine());
1104+
$this->assertSame('Function AssertDocblock\validateStringArrayIfFalse() never returns true so it can be removed from the return type.', $errors[1]->getMessage());
1105+
$this->assertSame(25, $errors[1]->getLine());
1106+
$this->assertSame('Function AssertDocblock\validateStringOrIntArray() never returns true so it can be removed from the return type.', $errors[2]->getMessage());
1107+
$this->assertSame(34, $errors[2]->getLine());
1108+
$this->assertSame('Function AssertDocblock\validateStringOrNonEmptyIntArray() never returns true so it can be removed from the return type.', $errors[3]->getMessage());
1109+
$this->assertSame(44, $errors[3]->getLine());
1110+
$this->assertSame('Call to method AssertDocblock\A::testInt() with string will always evaluate to false.', $errors[4]->getMessage());
1111+
$this->assertSame(218, $errors[4]->getLine());
1112+
$this->assertSame('Call to method AssertDocblock\A::testNotInt() with string will always evaluate to true.', $errors[5]->getMessage());
1113+
$this->assertSame(224, $errors[5]->getLine());
1114+
$this->assertSame('Call to method AssertDocblock\A::testInt() with int will always evaluate to true.', $errors[6]->getMessage());
1115+
$this->assertSame(232, $errors[6]->getLine());
1116+
$this->assertSame('Call to method AssertDocblock\A::testNotInt() with int will always evaluate to false.', $errors[7]->getMessage());
1117+
$this->assertSame(238, $errors[7]->getLine());
11101118
}
11111119

11121120
#[RequiresPhp('>= 8.0')]

tests/PHPStan/Analyser/nsrt/assert-docblock.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ function validateStringArray(array $arr) : void {}
1313
/**
1414
* @param mixed[] $arr
1515
* @phpstan-assert-if-true string[] $arr
16-
* @return true
1716
*/
1817
function validateStringArrayIfTrue(array $arr) : bool {
1918
return true;

tests/PHPStan/Rules/Comparison/DoWhileLoopConstantConditionRuleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class DoWhileLoopConstantConditionRuleTest extends RuleTestCase
1212
{
1313

14+
/** @var true */
1415
private bool $treatPhpDocTypesAsCertain = true;
1516

1617
protected function getRule(): Rule

tests/PHPStan/Rules/Comparison/LogicalXorConstantConditionRuleTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
class LogicalXorConstantConditionRuleTest extends RuleTestCase
1212
{
1313

14+
/** @var true */
1415
private bool $treatPhpDocTypesAsCertain;
1516

17+
/** @var false */
1618
private bool $reportAlwaysTrueInLastCondition = false;
1719

1820
protected function getRule(): TRule

tests/PHPStan/Rules/Comparison/WhileLoopAlwaysFalseConditionRuleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class WhileLoopAlwaysFalseConditionRuleTest extends RuleTestCase
1212
{
1313

14+
/** @var true */
1415
private bool $treatPhpDocTypesAsCertain = true;
1516

1617
protected function getRule(): Rule

tests/PHPStan/Rules/Comparison/WhileLoopAlwaysTrueConditionRuleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class WhileLoopAlwaysTrueConditionRuleTest extends RuleTestCase
1212
{
1313

14+
/** @var true */
1415
private bool $treatPhpDocTypesAsCertain = true;
1516

1617
protected function getRule(): Rule

tests/PHPStan/Rules/Exceptions/TooWideFunctionThrowTypeRuleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class TooWideFunctionThrowTypeRuleTest extends RuleTestCase
1212
{
1313

14+
/** @var true */
1415
private bool $implicitThrows = true;
1516

1617
protected function getRule(): Rule

tests/PHPStan/Rules/Exceptions/TooWidePropertyHookThrowTypeRuleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
class TooWidePropertyHookThrowTypeRuleTest extends RuleTestCase
1414
{
1515

16+
/** @var true */
1617
private bool $implicitThrows = true;
1718

1819
protected function getRule(): Rule

tests/PHPStan/Rules/Functions/ArrayValuesRuleTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class ArrayValuesRuleTest extends RuleTestCase
1313
{
1414

15+
/** @var true */
1516
private bool $treatPhpDocTypesAsCertain = true;
1617

1718
protected function getRule(): Rule

0 commit comments

Comments
 (0)