-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74ae46c
commit 53563e9
Showing
7 changed files
with
102 additions
and
54 deletions.
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
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
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,45 @@ | ||
<?php // lint >= 8.0 | ||
|
||
namespace Bug6114; | ||
|
||
/** | ||
* @template T | ||
*/ | ||
interface Foo { | ||
/** | ||
* @return T | ||
*/ | ||
public function bar(): mixed; | ||
} | ||
|
||
class HelloWorld | ||
{ | ||
/** | ||
* @template T | ||
* @param T $value | ||
* @return Foo<T> | ||
*/ | ||
public function sayHello(mixed $value): Foo | ||
{ | ||
return new | ||
/** | ||
* @template U | ||
* @implements Foo<U> | ||
*/ class($value) implements Foo { | ||
/** @var U */ | ||
private mixed $value; | ||
|
||
/** | ||
* @param U $value | ||
*/ | ||
public function __construct(mixed $value) { | ||
$this->value = $value; | ||
} | ||
|
||
public function bar(): mixed | ||
{ | ||
return $this->value; | ||
} | ||
}; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace PropertyTemplateTag; | ||
|
||
use function PHPStan\Testing\assertType; | ||
|
||
class BaseObject { } | ||
|
||
class ObjectDatabase | ||
{ | ||
|
||
/** Array of class, then key, then value to object array | ||
* @template T of BaseObject | ||
* @var array<class-string<T>, array<string, array<string, array<string, T>>>> */ | ||
private array $objectsByKey = array(); | ||
|
||
public function LoadObjectsByKey() : void | ||
{ | ||
assertType('array<class-string<PropertyTemplateTag\T>, array<string, array<string, array<string, PropertyTemplateTag\T>>>>', $this->objectsByKey); | ||
} | ||
} |