Completed
Branch master (cd0f1c)
by Michael
03:21
created

__TwigTemplate_81a5a2e078e398aaac3cde3041646c5e1242eda512e0f54725136a0c23b69b71   A

Complexity

Total Complexity 20

Size/Duplication

Total Lines 120
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 20
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 120
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 1
A doGetParent() 0 4 1
A doDisplay() 0 4 1
A block_title() 0 5 1
A block_body_class() 0 4 1
C block_page_content() 0 65 12
A getTemplateName() 0 4 1
A isTraitable() 0 4 1
A getDebugInfo() 0 4 1
1
<?php
2
3
/* namespaces.twig */
4
class __TwigTemplate_81a5a2e078e398aaac3cde3041646c5e1242eda512e0f54725136a0c23b69b71 extends Twig_Template
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
Coding Style introduced by
This class is not in CamelCase format.

Classes in PHP are usually named in CamelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. The whole name starts with a capital letter as well.

Thus the name database provider becomes DatabaseProvider.

Loading history...
5
{
6
    public function __construct(Twig_Environment $env)
7
    {
8
        parent::__construct($env);
9
10
        // line 1
11
        $this->parent = $this->loadTemplate("layout/layout.twig", "namespaces.twig", 1);
12
        $this->blocks = array(
13
            'title' => array($this, 'block_title'),
14
            'body_class' => array($this, 'block_body_class'),
15
            'page_content' => array($this, 'block_page_content'),
16
        );
17
    }
18
19
    protected function doGetParent(array $context)
20
    {
21
        return "layout/layout.twig";
22
    }
23
24
    protected function doDisplay(array $context, array $blocks = array())
25
    {
26
        $this->parent->display($context, array_merge($this->blocks, $blocks));
27
    }
28
29
    // line 2
30
    public function block_title($context, array $blocks = array())
0 ignored issues
show
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
31
    {
32
        echo "Namespaces | ";
33
        $this->displayParentBlock("title", $context, $blocks);
34
    }
35
36
    // line 3
37
    public function block_body_class($context, array $blocks = array())
0 ignored issues
show
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
38
    {
39
        echo "namespaces";
40
    }
41
42
    // line 5
43
    public function block_page_content($context, array $blocks = array())
0 ignored issues
show
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
44
    {
45
        // line 6
46
        echo "    <div class=\"page-header\">
47
        <h1>Namespaces</h1>
48
    </div>
49
50
    ";
51
        // line 10
52
        if ((isset($context["namespaces"]) ? $context["namespaces"] : $this->getContext($context, "namespaces"))) {
53
            // line 11
54
            echo "        <div class=\"namespaces clearfix\">
55
            ";
56
            // line 12
57
            $context["last_name"] = "";
58
            // line 13
59
            echo "            ";
60
            $context['_parent'] = $context;
61
            $context['_seq'] = twig_ensure_traversable((isset($context["namespaces"]) ? $context["namespaces"] : $this->getContext($context, "namespaces")));
62
            foreach ($context['_seq'] as $context["_key"] => $context["namespace"]) {
63
                // line 14
64
                echo "                ";
65
                $context["top_level"] = twig_first($this->env, twig_split_filter($this->env, $context["namespace"], "\\"));
66
                // line 15
67
                echo "                ";
68
                if (((isset($context["top_level"]) ? $context["top_level"] : $this->getContext($context, "top_level")) != (isset($context["last_name"]) ? $context["last_name"] : $this->getContext($context, "last_name")))) {
69
                    // line 16
70
                    echo "                    ";
71
                    if ((isset($context["last_name"]) ? $context["last_name"] : $this->getContext($context, "last_name"))) {
72
                        echo "</ul></div>";
73
                    }
74
                    // line 17
75
                    echo "                    <div class=\"namespace-container\">
76
                        <h2>";
77
                    // line 18
78
                    echo (isset($context["top_level"]) ? $context["top_level"] : $this->getContext($context, "top_level"));
79
                    echo "</h2>
80
                        <ul>
81
                    ";
82
                    // line 20
83
                    $context["last_name"] = (isset($context["top_level"]) ? $context["top_level"] : $this->getContext($context, "top_level"));
84
                    // line 21
85
                    echo "                ";
86
                }
87
                // line 22
88
                echo "                <li><a href=\"";
89
                echo $this->env->getExtension('sami')->pathForNamespace($context, $context["namespace"]);
90
                echo "\">";
91
                echo $context["namespace"];
92
                echo "</a></li>
93
            ";
94
            }
95
            $_parent = $context['_parent'];
96
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['namespace'], $context['_parent'], $context['loop']);
97
            $context = array_intersect_key($context, $_parent) + $_parent;
0 ignored issues
show
Unused Code introduced by
$context is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
98
            // line 24
99
            echo "                </ul>
100
            </div>
101
        </div>
102
    ";
103
        }
104
        // line 28
105
        echo "
106
";
107
    }
108
109
    public function getTemplateName()
110
    {
111
        return "namespaces.twig";
112
    }
113
114
    public function isTraitable()
115
    {
116
        return false;
117
    }
118
119
    public function getDebugInfo()
120
    {
121
        return array (  105 => 28,  99 => 24,  88 => 22,  85 => 21,  83 => 20,  78 => 18,  75 => 17,  70 => 16,  67 => 15,  64 => 14,  59 => 13,  57 => 12,  54 => 11,  52 => 10,  46 => 6,  43 => 5,  37 => 3,  30 => 2,  11 => 1,);
122
    }
123
}
124
/* {% extends "layout/layout.twig" %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
40% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
125
/* {% block title %}Namespaces | {{ parent() }}{% endblock %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
40% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
126
/* {% block body_class 'namespaces' %}*/
127
/* */
128
/* {% block page_content %}*/
129
/*     <div class="page-header">*/
130
/*         <h1>Namespaces</h1>*/
131
/*     </div>*/
132
/* */
133
/*     {% if namespaces %}*/
134
/*         <div class="namespaces clearfix">*/
135
/*             {% set last_name = '' %}*/
136
/*             {% for namespace in namespaces %}*/
137
/*                 {% set top_level = namespace|split('\\')|first %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
39% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
138
/*                 {% if top_level != last_name %}*/
139
/*                     {% if last_name %}</ul></div>{% endif %}*/
140
/*                     <div class="namespace-container">*/
141
/*                         <h2>{{ top_level|raw }}</h2>*/
142
/*                         <ul>*/
143
/*                     {% set last_name = top_level %}*/
144
/*                 {% endif %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
145
/*                 <li><a href="{{ namespace_path(namespace) }}">{{ namespace|raw }}</a></li>*/
146
/*             {% endfor %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
147
/*                 </ul>*/
148
/*             </div>*/
149
/*         </div>*/
150
/*     {% endif %}*/
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
151
/* */
152
/* {% endblock %}*/
153
/* */
154