1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 09:19:40 +01:00
psalm/src/Psalm/Internal/Analyzer/ClosureAnalyzer.php

23 lines
599 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();
$function_id = $source->getFilePath()
. ':' . $function->getLine()
. ':' . (int)$function->getAttribute('startFilePos')
. ':-:closure';
$storage = $codebase->getClosureStorage($source->getFilePath(), $function_id);
parent::__construct($function, $source, $storage);
}
2018-11-06 03:57:36 +01:00
}