Storm\Api\Caching\FunctionToASTConverter::FunctionToAST PHP Метод

FunctionToAST() публичный Метод

public FunctionToAST ( Storm\Core\Object\IEntityMap $EntityMap, callable $Function, $ResolveVariables = true )
$EntityMap Storm\Core\Object\IEntityMap
$Function callable
    public function FunctionToAST(Object\IEntityMap $EntityMap, callable $Function, $ResolveVariables = true)
    {
        $Reflection = $this->Reader->GetReflection($Function);
        $ClosureHash = $this->FunctionHash($Reflection);
        $AST = null;
        if ($this->Cache->Contains($ClosureHash)) {
            $AST = $this->Cache->Retrieve($ClosureHash);
        }
        if (!$AST instanceof Closure\IAST) {
            $AST = parent::FunctionToAST($EntityMap, $Function, false);
            //$AST->ExpandVariables();
            $AST->Simplify();
            $this->Cache->Save('ClosureAST-' . $ClosureHash, $AST);
        }
        if ($ResolveVariables) {
            $AST->Resolve($Reflection->getStaticVariables());
            $AST->Simplify();
        }
        return $AST;
    }