1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-04 18:48:03 +01:00
psalm/src/Psalm/Internal/Analyzer/ClosureAnalyzer.php

28 lines
718 B
PHP
Raw Normal View History

2018-11-06 03:57:36 +01:00
<?php
namespace Psalm\Internal\Analyzer;
/**
* @internal
*/
2018-11-06 03:57:36 +01:00
class ClosureAnalyzer extends FunctionLikeAnalyzer
{
public function __construct(\PhpParser\Node\Expr\Closure $function, SourceAnalyzer $source)
{
$codebase = $source->getCodebase();
2019-11-04 21:14:07 +01:00
$function_id = \strtolower($source->getFilePath())
. ':' . $function->getLine()
. ':' . (int)$function->getAttribute('startFilePos')
. ':-:closure';
$storage = $codebase->getClosureStorage($source->getFilePath(), $function_id);
parent::__construct($function, $source, $storage);
}
public function getTemplateTypeMap()
{
return $this->source->getTemplateTypeMap();
}
2018-11-06 03:57:36 +01:00
}