ContainerNode::compile()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Templates System.
5
 *
6
 * Copyright 2015 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2015 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Component\TemplatesSystem\Twig\Node;
16
17
use Twig\Compiler;
18
use Twig\Node\Node;
19
20
/**
21
 * @deprecated since 2.0, will be removed in 3.0
22
 * Container twig node.
23
 */
24
class ContainerNode extends Node
25
{
26
    public function __construct(Node $name, \Twig\Node\Expression\AbstractExpression $parameters = null, Node $body, $lineno, $tag = null)
27
    {
28
        $nodes = [
29
            'name' => $name,
30
            'body' => $body,
31
        ];
32
33
        if (!\is_null($parameters)) {
34
            $nodes['parameters'] = $parameters;
35
        }
36
37
        parent::__construct($nodes, [], $lineno, $tag);
38
    }
39
40
    public function compile(Compiler $compiler)
41
    {
42
        $compiler
43
            ->addDebugInfo($this)
44
            ->write("echo \"<!-- @deprecated: Container nodes are deprecated from 2.0, will be removed in 3.0 -->\"; \n");
45
    }
46
}
47