mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
parent
d29c7b42d9
commit
e6bd30cc0b
@ -19,4 +19,9 @@ class ClosureAnalyzer extends FunctionLikeAnalyzer
|
||||
|
||||
parent::__construct($function, $source, $storage);
|
||||
}
|
||||
|
||||
public function getTemplateTypeMap()
|
||||
{
|
||||
return $this->source->getTemplateTypeMap();
|
||||
}
|
||||
}
|
||||
|
@ -1618,6 +1618,26 @@ class ClassTemplateTest extends TestCase
|
||||
}
|
||||
}',
|
||||
],
|
||||
'insideClosureVarTemplate' => [
|
||||
'<?php
|
||||
/**
|
||||
* @template T of object
|
||||
*/
|
||||
class Foo {
|
||||
/**
|
||||
* @psalm-return callable(): ?T
|
||||
*/
|
||||
public function bar() {
|
||||
return
|
||||
/** @psalm-return ?T */
|
||||
function() {
|
||||
/** @psalm-var ?T */
|
||||
$data = null;
|
||||
return $data;
|
||||
};
|
||||
}
|
||||
}',
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user