Hostnet\Bundle\WebpackBundle\Twig\Token\WebpackTokenParser::parseInline PHP Method

parseInline() private method

private parseInline ( Twig_TokenStream $stream, integer $lineno ) : Hostnet\Bundle\WebpackBundle\Twig\Node\WebpackInlineNode
$stream Twig_TokenStream
$lineno integer
return Hostnet\Bundle\WebpackBundle\Twig\Node\WebpackInlineNode
    private function parseInline(\Twig_TokenStream $stream, $lineno)
    {
        if ($stream->test(\Twig_Token::NAME_TYPE)) {
            $stream->next();
        }
        $stream->expect(\Twig_Token::BLOCK_END_TYPE);
        $this->parser->subparse(function ($token) {
            return $token->test(['end' . $this->getTag()]);
        }, true);
        $stream->expect(\Twig_Token::BLOCK_END_TYPE);
        $file = $this->parser->getEnvironment()->getLoader()->getCacheKey($stream->getFilename());
        if (!isset($this->inline_blocks[$file])) {
            $this->inline_blocks[$file] = 0;
        }
        $file_name = TwigParser::hashInlineFileName($file, $this->inline_blocks[$file]) . '.js';
        $assets = $this->extension->webpackAsset('cache.' . $file_name);
        $this->inline_blocks[$file]++;
        return new WebpackInlineNode(['js_file' => $assets['js'], 'css_file' => $assets['css']], $lineno, $this->getTag());
    }