Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix interaction between template type and intersection type
- Loading branch information
1 parent
21947ff
commit f8af5dc
Showing
4 changed files
with
138 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ public function dataTopics(): array | |
['bug2620'], | ||
['bug2622'], | ||
['bug2627'], | ||
['bug6210'], | ||
]; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Generics\Bug6210; | ||
|
||
/** | ||
* @template TEntityClass of object | ||
*/ | ||
class HelloWorld | ||
{ | ||
/** | ||
* @phpstan-param TEntityClass $entity | ||
*/ | ||
public function provide($entity, ?string $value): void | ||
{ | ||
if (null !== $value) { | ||
if (!method_exists($entity, 'getId')) { | ||
throw new \InvalidArgumentException(); | ||
} | ||
} | ||
$this->show($entity); | ||
} | ||
|
||
/** | ||
* @phpstan-param TEntityClass $entity | ||
*/ | ||
private function show($entity): void | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters