Skip to content

Commit aa8d2a5

Browse files
committed
Create bug-5058.php
1 parent 22f51ec commit aa8d2a5

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace Bug5058;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class test{
8+
9+
private string $properString;
10+
11+
public function doSomething(mixed $string): void
12+
{
13+
14+
$errors = [];
15+
if(is_string($string) === false){
16+
$errors['string'] = 'fail';
17+
}
18+
19+
if(empty($errors) === false){
20+
throw new Exception('Epic fail');
21+
}
22+
23+
assertType('string', $string);
24+
$this->properString = $string;
25+
}
26+
27+
public function getProperString(): string
28+
{
29+
return $this->properString;
30+
}
31+
32+
}

0 commit comments

Comments
 (0)