src/Phn/Dal/Engine.php
public function build()
    {
        $tokenParsers = [];
        $executionStrategies = [];
        $functions = [];

        foreach ($this->extensions as $extension) {
            $tokenParsers = array_merge($tokenParsers, $extension->getTokenParsers());
            $executionStrategies = array_merge($executionStrategies, $extension->getExecutionStrategies());
            $functions = array_merge($functions, $extension->getFunctions());
        }

        $registry = new Registry($tokenParsers, [], [], '<{', '}>');

        $this->syntax = new Syntax(new Lexer(new TemplateLexer($registry)), new Parser(new TemplateParser($registry)));

        $this->executionStrategies = new ExecutionStrategyCollection($executionStrategies);

        $this->environment = new Environment($functions);

        $this->isLocked = true;
    }
public function build()
    {
        $tokenParsers = [];
        $executionStrategies = [];
        $functions = [];

        foreach ($this->extensions as $extension) {
            $tokenParsers = array_merge($tokenParsers, $extension->getTokenParsers());
            $executionStrategies = array_merge($executionStrategies, $extension->getExecutionStrategies());
            $functions = array_merge($functions, $extension->getFunctions());
        }

        $registry = new Registry($tokenParsers, [], [], '<{', '}>');

        $this->syntax = new Syntax(new Lexer(new TemplateLexer($registry)), new Parser(new TemplateParser($registry)));

        $this->executionStrategies = new ExecutionStrategyCollection($executionStrategies);

        $this->environment = new Environment($functions);

        $this->isLocked = true;
    }
public function build ( ) { $ tokenParsers = [ ] ; $ executionStrategies = [ ] ; $ functions = [ ] ; foreach ( $ this -> extensions as $ extension ) { $ tokenParsers = array_merge ( $ tokenParsers , $ extension -> getTokenParsers ( ) ) ; $ executionStrategies = array_merge ( $ executionStrategies , $ extension -> getExecutionStrategies ( ) ) ; $ functions = array_merge ( $ functions , $ extension -> getFunctions ( ) ) ; } $ registry = new Registry ( $ tokenParsers , [ ] , [ ] , '<{' , '}>' ) ; $ this -> syntax = new Syntax ( new Lexer ( new TemplateLexer ( $ registry ) ) , new Parser ( new TemplateParser ( $ registry ) ) ) ; $ this -> executionStrategies = new ExecutionStrategyCollection ( $ executionStrategies ) ; $ this -> environment = new Environment ( $ functions ) ; $ this -> isLocked = true ; }
Builds the Engine.
Builds the Engine .