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

__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 9
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 14
rs 9.9666
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/menu_blocks.html.twig */
16
class __TwigTemplate_098b712e456ffb4abe16e26acf026bf39dbc0c4dc8ae59c0eef8706b32b55aee 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
            'item' => [$this, 'block_item'],
31
            'menu' => [$this, 'block_menu'],
32
            'section' => [$this, 'block_section'],
33
            'system' => [$this, 'block_system'],
34
            'icon' => [$this, 'block_icon'],
35
        ];
36
    }
37
38
    protected function doDisplay(array $context, array $blocks = [])
39
    {
40
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
41
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
42
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "@Menu/menu_blocks.html.twig"));
43
44
        // line 1
45
        $this->displayBlock('item', $context, $blocks);
46
        // line 18
47
        echo "
48
";
49
        // line 19
50
        $this->displayBlock('menu', $context, $blocks);
51
        // line 32
52
        echo "
53
";
54
        // line 33
55
        $this->displayBlock('section', $context, $blocks);
56
        // line 42
57
        echo "
58
";
59
        // line 43
60
        $this->displayBlock('system', $context, $blocks);
61
        // line 48
62
        echo "
63
";
64
        // line 49
65
        $this->displayBlock('icon', $context, $blocks);
66
        // line 56
67
        echo "
68
69
70
71
";
72
        
73
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
74
75
    }
76
77
    // line 1
78
    public function block_item($context, array $blocks = [])
79
    {
80
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
81
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
82
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "item"));
83
84
        // line 2
85
        echo "    ";
86
        $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.', 2, $this->source); })()), "routeParameters", [], "any", false, false, false, 2)) ? ($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.', 2, $this->source); })()), "routeName", [], "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); })()), "routeParameters", [], "any", false, false, false, 2))) : ($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.', 2, $this->source); })()), "routeName", [], "any", false, false, false, 2))));
87
        // line 3
88
        echo "    ";
89
        $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.', 3, $this->source); })()), "label", [], "any", false, false, false, 3);
90
        // line 4
91
        echo "    ";
92
        $context["icon"] = 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.', 4, $this->source); })()), "icon", [], "any", false, false, false, 4);
93
        // line 5
94
        echo "    ";
95
        $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.', 5, $this->source); })()));
96
        // line 6
97
        echo "    ";
98
        $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.', 6, $this->source); })()), null)) : (null));
99
        // line 7
100
        echo "
101
    ";
102
        // line 8
103
        $context["current"] = (((isset($context["selectedSubnavItem"]) || array_key_exists("selectedSubnavItem", $context) ? $context["selectedSubnavItem"] : (function () { throw new RuntimeError('Variable "selectedSubnavItem" does not exist.', 8, $this->source); })()) === (isset($context["handle"]) || array_key_exists("handle", $context) ? $context["handle"] : (function () { throw new RuntimeError('Variable "handle" does not exist.', 8, $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.', 8, $this->source); })()), "current", [], "any", false, false, false, 8));
104
        // line 9
105
        echo "    ";
106
        $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.', 9, $this->source); })()), "inActiveTrail", [], "any", false, false, false, 9);
107
        // line 10
108
        echo "
109
    <a href=\"";
110
        // line 11
111
        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.', 11, $this->source); })()), "html", null, true);
112
        echo "\"
113
       ";
114
        // line 12
115
        if (((isset($context["current"]) || array_key_exists("current", $context) ? $context["current"] : (function () { throw new RuntimeError('Variable "current" does not exist.', 12, $this->source); })()) || (isset($context["inActiveTrail"]) || array_key_exists("inActiveTrail", $context) ? $context["inActiveTrail"] : (function () { throw new RuntimeError('Variable "inActiveTrail" does not exist.', 12, $this->source); })()))) {
116
            echo "class=\"active ";
117
            echo (((isset($context["current"]) || array_key_exists("current", $context) ? $context["current"] : (function () { throw new RuntimeError('Variable "current" does not exist.', 12, $this->source); })())) ? ("underline") : (""));
118
            echo "\"";
119
        }
120
        // line 13
121
        echo "    >
122
        ";
123
        // line 14
124
        $this->displayBlock("icon", $context, $blocks);
125
        echo "
126
        ";
127
        // line 15
128
        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.', 15, $this->source); })()), "html", null, true);
129
        echo "
130
    </a>
131
";
132
        
133
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
134
135
    }
136
137
    // line 19
138
    public function block_menu($context, array $blocks = [])
139
    {
140
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
141
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
142
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "menu"));
143
144
        // line 20
145
        echo "    ";
146
        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.', 20, $this->source); })()), "type", [], "any", false, false, false, 20) === twig_constant("Braunstetter\\MenuBundle\\Items\\MenuItem::TYPE_SYSTEM"))) {
147
            // line 21
148
            echo "        ";
149
            $this->displayBlock("system", $context, $blocks);
150
            echo "
151
    ";
152
        }
153
        // line 23
154
        echo "
155
    ";
156
        // line 24
157
        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.', 24, $this->source); })()), "type", [], "any", false, false, false, 24) === twig_constant("Braunstetter\\MenuBundle\\Items\\MenuItem::TYPE_SECTION"))) {
158
            // line 25
159
            echo "        ";
160
            $this->displayBlock("section", $context, $blocks);
161
            echo "
162
    ";
163
        }
164
        // line 27
165
        echo "
166
    ";
167
        // line 28
168
        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.', 28, $this->source); })()), "type", [], "any", false, false, false, 28) === twig_constant("Braunstetter\\MenuBundle\\Items\\MenuItem::TYPE_ROUTE"))) {
169
            // line 29
170
            echo "        ";
171
            $this->displayBlock("item", $context, $blocks);
172
            echo "
173
    ";
174
        }
175
        
176
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
177
178
    }
179
180
    // line 33
181
    public function block_section($context, array $blocks = [])
182
    {
183
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
184
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
185
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "section"));
186
187
        // line 34
188
        echo "    ";
189
        $this->displayBlock("item", $context, $blocks);
190
        echo "
191
192
    <div class=\"section\">
193
        ";
194
        // line 37
195
        $context['_parent'] = $context;
196
        $context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, $context["entry"], "children", [], "any", false, false, false, 37));
197
        $context['loop'] = [
198
          'parent' => $context['_parent'],
199
          'index0' => 0,
200
          'index'  => 1,
201
          'first'  => true,
202
        ];
203
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
204
            $length = count($context['_seq']);
205
            $context['loop']['revindex0'] = $length - 1;
206
            $context['loop']['revindex'] = $length;
207
            $context['loop']['length'] = $length;
208
            $context['loop']['last'] = 1 === $length;
209
        }
210
        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...
211
            // line 38
212
            echo "            ";
213
            $this->displayBlock("menu", $context, $blocks);
214
            echo "
215
        ";
216
            ++$context['loop']['index0'];
217
            ++$context['loop']['index'];
218
            $context['loop']['first'] = false;
219
            if (isset($context['loop']['length'])) {
220
                --$context['loop']['revindex0'];
221
                --$context['loop']['revindex'];
222
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
223
            }
224
        }
225
        $_parent = $context['_parent'];
226
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entry'], $context['_parent'], $context['loop']);
227
        $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...
228
        // line 40
229
        echo "    </div>
230
";
231
        
232
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
233
234
    }
235
236
    // line 43
237
    public function block_system($context, array $blocks = [])
238
    {
239
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
240
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
241
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "system"));
242
243
        // line 44
244
        echo "    <div class=\"system\">
245
        ";
246
        // line 45
247
        $this->displayBlock("section", $context, $blocks);
248
        echo "
249
    </div>
250
";
251
        
252
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
253
254
    }
255
256
    // line 49
257
    public function block_icon($context, array $blocks = [])
0 ignored issues
show
Unused Code introduced by
The parameter $blocks is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

257
    public function block_icon($context, /** @scrutinizer ignore-unused */ array $blocks = [])

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
258
    {
259
        $macros = $this->macros;
0 ignored issues
show
Unused Code introduced by
The assignment to $macros is dead and can be removed.
Loading history...
260
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
261
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "icon"));
262
263
        // line 50
264
        echo "    ";
265
        if ((isset($context["icon"]) || array_key_exists("icon", $context) ? $context["icon"] : (function () { throw new RuntimeError('Variable "icon" does not exist.', 50, $this->source); })())) {
266
            // line 51
267
            echo "        ";
268
            echo twig_source($this->env, (isset($context["icon"]) || array_key_exists("icon", $context) ? $context["icon"] : (function () { throw new RuntimeError('Variable "icon" does not exist.', 51, $this->source); })()));
269
            echo "
270
    ";
271
        } else {
272
            // line 53
273
            echo "        ";
274
            echo twig_source($this->env, "@Menu/svg/default_folder.svg");
275
            echo "
276
    ";
277
        }
278
        
279
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
280
281
    }
282
283
    public function getTemplateName()
284
    {
285
        return "@Menu/menu_blocks.html.twig";
286
    }
287
288
    public function getDebugInfo()
289
    {
290
        return array (  273 => 53,  267 => 51,  264 => 50,  257 => 49,  247 => 45,  244 => 44,  237 => 43,  229 => 40,  212 => 38,  195 => 37,  188 => 34,  181 => 33,  170 => 29,  168 => 28,  165 => 27,  159 => 25,  157 => 24,  154 => 23,  148 => 21,  145 => 20,  138 => 19,  128 => 15,  124 => 14,  121 => 13,  115 => 12,  111 => 11,  108 => 10,  105 => 9,  103 => 8,  100 => 7,  97 => 6,  94 => 5,  91 => 4,  88 => 3,  85 => 2,  78 => 1,  67 => 56,  65 => 49,  62 => 48,  60 => 43,  57 => 42,  55 => 33,  52 => 32,  50 => 19,  47 => 18,  45 => 1,);
291
    }
292
293
    public function getSourceContext()
294
    {
295
        return new Source("{% block item %}
296
    {% set path = entry.routeParameters ? path(entry.routeName, entry.routeParameters) : path(entry.routeName) %}
297
    {% set label = entry.label %}
298
    {% set icon = entry.icon %}
299
    {% set handle = label|lower %}
300
    {% set selectedSubnavItem = selectedSubnavItem|default(null) %}
301
302
    {% set current = selectedSubnavItem is same as handle or entry.current %}
303
    {% set inActiveTrail = entry.inActiveTrail %}
304
305
    <a href=\"{{ path }}\"
306
       {% if current or inActiveTrail %}class=\"active {{ current ? 'underline' }}\"{% endif %}
307
    >
308
        {{ block('icon') }}
309
        {{ label }}
310
    </a>
311
{% endblock %}
312
313
{% block menu %}
314
    {% if entry.type is same as constant('Braunstetter\\\\MenuBundle\\\\Items\\\\MenuItem::TYPE_SYSTEM') %}
315
        {{ block('system') }}
316
    {% endif %}
317
318
    {% if entry.type is same as constant('Braunstetter\\\\MenuBundle\\\\Items\\\\MenuItem::TYPE_SECTION') %}
319
        {{ block('section') }}
320
    {% endif %}
321
322
    {% if entry.type is same as constant('Braunstetter\\\\MenuBundle\\\\Items\\\\MenuItem::TYPE_ROUTE') %}
323
        {{ block('item') }}
324
    {% endif %}
325
{% endblock %}
326
327
{% block section %}
328
    {{ block('item') }}
329
330
    <div class=\"section\">
331
        {% for entry in entry.children %}
332
            {{ block('menu') }}
333
        {% endfor %}
334
    </div>
335
{% endblock %}
336
337
{% block system %}
338
    <div class=\"system\">
339
        {{ block('section') }}
340
    </div>
341
{% endblock %}
342
343
{% block icon %}
344
    {% if icon %}
345
        {{ source(icon) }}
346
    {% else %}
347
        {{ source('@Menu/svg/default_folder.svg') }}
348
    {% endif %}
349
{% endblock %}
350
351
352
353
354
", "@Menu/menu_blocks.html.twig", "/Users/michaelbrauner/Bundles/Symfony/MenuBundle/src/Resources/views/menu_blocks.html.twig");
355
    }
356
}
357