Test Failed
Push — main ( 109ef1...0eb966 )
by Michael
02:49
created

doDisplay()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 15
rs 10
1
<?php
2
3
use Twig\Environment;
4
use Twig\Error\LoaderError;
5
use Twig\Error\RuntimeError;
6
use Twig\Extension\SandboxExtension;
7
use Twig\Markup;
8
use Twig\Sandbox\SecurityError;
9
use Twig\Sandbox\SecurityNotAllowedTagError;
10
use Twig\Sandbox\SecurityNotAllowedFilterError;
11
use Twig\Sandbox\SecurityNotAllowedFunctionError;
12
use Twig\Source;
13
use Twig\Template;
14
15
/* @Menu/breadcrumb_menu_blocks.html.twig */
16
class __TwigTemplate_cb72583f1f22b21397b6fc8b4d9b91994a04ee9aa55bdfa5613296f92a168536 extends Template
17
{
18
    private $source;
19
    private $macros = [];
20
21
    public function __construct(Environment $env)
22
    {
23
        parent::__construct($env);
24
25
        $this->source = $this->getSourceContext();
26
27
        $this->parent = false;
28
29
        $this->blocks = [
30
            'menu' => [$this, 'block_menu'],
31
            'item' => [$this, 'block_item'],
32
        ];
33
    }
34
35
    protected function doDisplay(array $context, array $blocks = [])
36
    {
37
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
38
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
39
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Menu/breadcrumb_menu_blocks.html.twig"));
40
41
        // line 1
42
        $this->displayBlock('menu', $context, $blocks);
43
        // line 6
44
        echo "
45
";
46
        // line 7
47
        $this->displayBlock('item', $context, $blocks);
48
        
49
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
50
51
    }
52
53
    // line 1
54
    public function block_menu($context, array $blocks = [])
55
    {
56
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
57
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
58
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "menu"));
59
60
        // line 2
61
        echo "    ";
62
        if ((twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 2, $this->source); })()), "inActiveTrail", [], "any", false, false, false, 2) || twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 2, $this->source); })()), "current", [], "any", false, false, false, 2))) {
63
            // line 3
64
            echo "        ";
65
            $this->displayBlock("item", $context, $blocks);
66
            echo "
67
    ";
68
        }
69
        
70
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
71
72
    }
73
74
    // line 7
75
    public function block_item($context, array $blocks = [])
76
    {
77
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
78
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
79
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "item"));
80
81
        // line 8
82
        echo "    ";
83
        $context["path"] = ((twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 8, $this->source); })()), "routeParameters", [], "any", false, false, false, 8)) ? ($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath(twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 8, $this->source); })()), "routeName", [], "any", false, false, false, 8), twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 8, $this->source); })()), "routeParameters", [], "any", false, false, false, 8))) : ($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath(twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 8, $this->source); })()), "routeName", [], "any", false, false, false, 8))));
84
        // line 9
85
        echo "    ";
86
        $context["label"] = twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 9, $this->source); })()), "label", [], "any", false, false, false, 9);
87
        // line 10
88
        echo "    ";
89
        $context["handle"] = twig_lower_filter($this->env, (isset($context["label"]) || array_key_exists("label", $context) ? $context["label"] : (function () { throw new RuntimeError('Variable "label" does not exist.', 10, $this->source); })()));
90
        // line 11
91
        echo "    ";
92
        $context["selectedSubnavItem"] = ((array_key_exists("selectedSubnavItem", $context)) ? (_twig_default_filter((isset($context["selectedSubnavItem"]) || array_key_exists("selectedSubnavItem", $context) ? $context["selectedSubnavItem"] : (function () { throw new RuntimeError('Variable "selectedSubnavItem" does not exist.', 11, $this->source); })()), null)) : (null));
93
        // line 12
94
        echo "
95
    ";
96
        // line 13
97
        $context["current"] = (((isset($context["selectedSubnavItem"]) || array_key_exists("selectedSubnavItem", $context) ? $context["selectedSubnavItem"] : (function () { throw new RuntimeError('Variable "selectedSubnavItem" does not exist.', 13, $this->source); })()) === (isset($context["handle"]) || array_key_exists("handle", $context) ? $context["handle"] : (function () { throw new RuntimeError('Variable "handle" does not exist.', 13, $this->source); })())) || twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 13, $this->source); })()), "current", [], "any", false, false, false, 13));
98
        // line 14
99
        echo "    ";
100
        $context["inActiveTrail"] = twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 14, $this->source); })()), "inActiveTrail", [], "any", false, false, false, 14);
101
        // line 15
102
        echo "
103
    <a href=\"";
104
        // line 16
105
        echo twig_escape_filter($this->env, (isset($context["path"]) || array_key_exists("path", $context) ? $context["path"] : (function () { throw new RuntimeError('Variable "path" does not exist.', 16, $this->source); })()), "html", null, true);
106
        echo "\"
107
       ";
108
        // line 17
109
        if (((isset($context["current"]) || array_key_exists("current", $context) ? $context["current"] : (function () { throw new RuntimeError('Variable "current" does not exist.', 17, $this->source); })()) || (isset($context["inActiveTrail"]) || array_key_exists("inActiveTrail", $context) ? $context["inActiveTrail"] : (function () { throw new RuntimeError('Variable "inActiveTrail" does not exist.', 17, $this->source); })()))) {
110
            echo "class=\"active ";
111
            echo (((isset($context["current"]) || array_key_exists("current", $context) ? $context["current"] : (function () { throw new RuntimeError('Variable "current" does not exist.', 17, $this->source); })())) ? ("current") : (""));
112
            echo "\"";
113
        }
114
        // line 18
115
        echo "    >
116
117
        <span>";
118
        // line 20
119
        echo twig_escape_filter($this->env, (isset($context["label"]) || array_key_exists("label", $context) ? $context["label"] : (function () { throw new RuntimeError('Variable "label" does not exist.', 20, $this->source); })()), "html", null, true);
120
        echo "</span>
121
        ";
122
        // line 21
123
        if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["entry"]) || array_key_exists("entry", $context) ? $context["entry"] : (function () { throw new RuntimeError('Variable "entry" does not exist.', 21, $this->source); })()), "children", [], "any", false, false, false, 21))) {
124
            // line 22
125
            echo "            ";
126
            echo twig_source($this->env, "@Menu/svg/caret.svg");
127
            echo "
128
        ";
129
        }
130
        // line 24
131
        echo "    </a>
132
133
    ";
134
        // line 26
135
        $context['_parent'] = $context;
136
        $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["entry"], "children", [], "any", false, false, false, 26));
137
        $context['loop'] = [
138
          'parent' => $context['_parent'],
139
          'index0' => 0,
140
          'index'  => 1,
141
          'first'  => true,
142
        ];
143
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
144
            $length = count($context['_seq']);
145
            $context['loop']['revindex0'] = $length - 1;
146
            $context['loop']['revindex'] = $length;
147
            $context['loop']['length'] = $length;
148
            $context['loop']['last'] = 1 === $length;
149
        }
150
        foreach ($context['_seq'] as $context["_key"] => $context["entry"]) {
0 ignored issues
show
introduced by
$context is overwriting one of the parameters of this function.
Loading history...
151
            // line 27
152
            echo "        ";
153
            $this->displayBlock("menu", $context, $blocks);
154
            echo "
155
    ";
156
            ++$context['loop']['index0'];
157
            ++$context['loop']['index'];
158
            $context['loop']['first'] = false;
159
            if (isset($context['loop']['length'])) {
160
                --$context['loop']['revindex0'];
161
                --$context['loop']['revindex'];
162
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
163
            }
164
        }
165
        $_parent = $context['_parent'];
166
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entry'], $context['_parent'], $context['loop']);
167
        $context = array_intersect_key($context, $_parent) + $_parent;
0 ignored issues
show
Unused Code introduced by
The assignment to $context is dead and can be removed.
Loading history...
168
        
169
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
170
171
    }
172
173
    public function getTemplateName()
174
    {
175
        return "@Menu/breadcrumb_menu_blocks.html.twig";
176
    }
177
178
    public function getDebugInfo()
179
    {
180
        return array (  152 => 27,  135 => 26,  131 => 24,  125 => 22,  123 => 21,  119 => 20,  115 => 18,  109 => 17,  105 => 16,  102 => 15,  99 => 14,  97 => 13,  94 => 12,  91 => 11,  88 => 10,  85 => 9,  82 => 8,  75 => 7,  64 => 3,  61 => 2,  54 => 1,  47 => 7,  44 => 6,  42 => 1,);
181
    }
182
183
    public function getSourceContext()
184
    {
185
        return new Source("{% block menu %}
186
    {% if entry.inActiveTrail or entry.current %}
187
        {{ block('item') }}
188
    {% endif %}
189
{% endblock %}
190
191
{% block item %}
192
    {% set path = entry.routeParameters ? path(entry.routeName, entry.routeParameters) : path(entry.routeName) %}
193
    {% set label = entry.label %}
194
    {% set handle = label|lower %}
195
    {% set selectedSubnavItem = selectedSubnavItem|default(null) %}
196
197
    {% set current = selectedSubnavItem is same as handle or entry.current %}
198
    {% set inActiveTrail = entry.inActiveTrail %}
199
200
    <a href=\"{{ path }}\"
201
       {% if current or inActiveTrail %}class=\"active {{ current ? 'current' }}\"{% endif %}
202
    >
203
204
        <span>{{ label }}</span>
205
        {% if entry.children is not empty %}
206
            {{ source('@Menu/svg/caret.svg') }}
207
        {% endif %}
208
    </a>
209
210
    {% for entry in entry.children %}
211
        {{ block('menu') }}
212
    {% endfor %}
213
{% endblock %}", "@Menu/breadcrumb_menu_blocks.html.twig", "/Users/michaelbrauner/Bundles/Symfony/MenuBundle/src/Resources/views/breadcrumb_menu_blocks.html.twig");
214
    }
215
}
216