mirror of
https://github.com/danog/psalm.git
synced 2024-12-15 02:47:02 +01:00
23 lines
599 B
PHP
23 lines
599 B
PHP
<?php
|
|
namespace Psalm\Internal\Analyzer;
|
|
|
|
/**
|
|
* @internal
|
|
*/
|
|
class ClosureAnalyzer extends FunctionLikeAnalyzer
|
|
{
|
|
public function __construct(\PhpParser\Node\Expr\Closure $function, SourceAnalyzer $source)
|
|
{
|
|
$codebase = $source->getCodebase();
|
|
|
|
$function_id = $source->getFilePath()
|
|
. ':' . $function->getLine()
|
|
. ':' . (int)$function->getAttribute('startFilePos')
|
|
. ':-:closure';
|
|
|
|
$storage = $codebase->getClosureStorage($source->getFilePath(), $function_id);
|
|
|
|
parent::__construct($function, $source, $storage);
|
|
}
|
|
}
|