Skip to content

Commit

Permalink
Added regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Oct 6, 2023
1 parent 94ad039 commit 6b5e98f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1455,4 +1455,9 @@ public function testBug8659(): void
$this->analyse([__DIR__ . '/data/bug-8659.php'], []);
}

public function testBug9580(): void
{
$this->analyse([__DIR__ . '/data/bug-9580.php'], []);
}

}
22 changes: 22 additions & 0 deletions tests/PHPStan/Rules/Functions/data/bug-9580.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Bug9580;


function test(): int|string|float|null
{
return $_GET['value'];
}

function onlyNull(null $value): void
{

}

function doFoo() {
$value = test();
if (isset($value)) {
exit;
}
onlyNull($value);
}

0 comments on commit 6b5e98f

Please sign in to comment.