-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Type description verbosity - be more verbose when invariant template …
…type is involved
- Loading branch information
1 parent
5efd078
commit d97ddee
Showing
12 changed files
with
153 additions
and
14 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
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
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,75 @@ | ||
<?php | ||
|
||
namespace Bug4590; | ||
|
||
/** | ||
* @template T | ||
*/ | ||
class OkResponse | ||
{ | ||
/** | ||
* @phpstan-var T | ||
*/ | ||
private $body; | ||
|
||
/** | ||
* @phpstan-param T $body | ||
*/ | ||
public function __construct($body) | ||
{ | ||
$this->body = $body; | ||
} | ||
|
||
/** | ||
* @phpstan-return T | ||
*/ | ||
public function getBody() | ||
{ | ||
return $this->body; | ||
} | ||
} | ||
|
||
class Controller | ||
{ | ||
/** | ||
* @return OkResponse<array<string, string>> | ||
*/ | ||
public function test1(): OkResponse | ||
{ | ||
return new OkResponse(["ok" => "hello"]); | ||
} | ||
|
||
/** | ||
* @return OkResponse<array<int, string>> | ||
*/ | ||
public function test2(): OkResponse | ||
{ | ||
return new OkResponse([0 => "hello"]); | ||
} | ||
|
||
/** | ||
* @return OkResponse<string[]> | ||
*/ | ||
public function test3(): OkResponse | ||
{ | ||
return new OkResponse(["hello"]); | ||
} | ||
|
||
/** | ||
* @return OkResponse<string> | ||
*/ | ||
public function test4(): OkResponse | ||
{ | ||
return new OkResponse("hello"); | ||
} | ||
|
||
/** | ||
* @param array<int, string> $a | ||
* @return OkResponse<array<int, string>> | ||
*/ | ||
public function test5(array $a): OkResponse | ||
{ | ||
return new OkResponse($a); | ||
} | ||
|
||
} |