2018-11-06 03:57:36 +01:00
|
|
|
<?php
|
|
|
|
namespace Psalm\Internal\Analyzer;
|
|
|
|
|
2018-12-02 00:37:49 +01:00
|
|
|
/**
|
|
|
|
* @internal
|
|
|
|
*/
|
2018-11-06 03:57:36 +01:00
|
|
|
class ClosureAnalyzer extends FunctionLikeAnalyzer
|
|
|
|
{
|
2018-12-18 05:29:27 +01:00
|
|
|
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
|
|
|
}
|