-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Labels
Description
I have this block in my code:
<?php
/**
* API interop.
*
* @template T
* @phpstan-type ResponsePayload array{
* data: T,
* links: ?array{
* self: string,
* first: string,
* last: string,
* next: string,
* },
* pager: ?array{
* total: int,
* current: int,
* limit: int,
* },
* } API response template
*/
class X {
/** @return ResponsePayload<array> */
function x(): array {
return ['data' => []];
}
function y() {
$x = $this->x()['data'];
}
}I can't complete the data key in the y() function, unless I remove the specifier.
What I'm doing wrong?
Reactions are currently unavailable