-
Notifications
You must be signed in to change notification settings - Fork 574
Expand file tree
/
Copy pathbug-13736.php
More file actions
42 lines (32 loc) · 781 Bytes
/
bug-13736.php
File metadata and controls
42 lines (32 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php declare(strict_types = 1);
namespace Bug13736;
use function PHPStan\Testing\assertType;
class BaseClass {
final public static function assertTrue(mixed $condition, string $message = ''): void
{
}
public function doSomething(): void
{
}
}
class Bug13736Test extends BaseClass
{
private static ?Foo $foo = null;
private ?Foo $instanceFoo = null;
public function testStaticProperty(): void
{
self::$foo = new Foo();
assertType('Bug13736\Foo', self::$foo);
self::assertTrue(true);
assertType('Bug13736\Foo', self::$foo);
}
public function testInstanceProperty(): void
{
$this->instanceFoo = new Foo();
assertType('Bug13736\Foo', $this->instanceFoo);
parent::doSomething();
assertType('Bug13736\Foo', $this->instanceFoo);
}
}
class Foo {
}