-
Notifications
You must be signed in to change notification settings - Fork 428
/
bug-5591.php
46 lines (39 loc) · 878 Bytes
/
bug-5591.php
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
43
44
45
46
<?php
declare(strict_types=1);
namespace Bug5591;
class EntityA {}
class EntityB {}
/**
* @template TEntity as object
*/
class TestClass
{
/** @var class-string<TEntity> The fully-qualified (::class) class name of the entity being managed. */
protected $entityClass;
/** @param TEntity|null $record */
public function outerMethod($record = null): void
{
$record = $this->innerMethod($record);
}
/**
* @param TEntity|null $record
*
* @return TEntity
*/
public function innerMethod($record = null): object
{
$class = $this->entityClass;
return new $class();
}
}
/**
* @template TEntity as EntityA|EntityB
* @extends TestClass<TEntity>
*/
class TestClass2 extends TestClass
{
public function outerMethod($record = null): void
{
$record = $this->innerMethod($record);
}
}