File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
Bundle/WebProfilerBundle/Resources/views/Profiler Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change 72
72
<ul id =" menu-profiler" >
73
73
{% for name , template in templates %}
74
74
{% set menu -%}
75
- {% if block (' menu' , template ) is defined %}
75
+ {%- if block (' menu' , template ) is defined - %}
76
76
{% with { collector : profile.getcollector (name ), profiler_markup_version : profiler_markup_version } %}
77
77
{{- block (' menu' , template ) -}}
78
78
{% endwith %}
79
- {% endif %}
79
+ {%- endif - %}
80
80
{%- endset %}
81
81
{% if menu is not empty %}
82
82
<li class =" {{ name }} {{ name == panel ? ' selected' : ' ' }}" >
Original file line number Diff line number Diff line change @@ -46,13 +46,7 @@ public function loadClassMetadata(ClassMetadata $metadata)
46
46
$ this ->yamlParser = new YamlParser ();
47
47
}
48
48
49
- // This method may throw an exception. Do not modify the class'
50
- // state before it completes
51
- if (false === ($ classes = $ this ->parseFile ($ this ->file ))) {
52
- return false ;
53
- }
54
-
55
- $ this ->classes = $ classes ;
49
+ $ this ->classes = $ this ->parseFile ($ this ->file );
56
50
57
51
if (isset ($ this ->classes ['namespaces ' ])) {
58
52
foreach ($ this ->classes ['namespaces ' ] as $ alias => $ namespace ) {
@@ -111,7 +105,7 @@ protected function parseNodes(array $nodes)
111
105
*
112
106
* @param string $path The path of the YAML file
113
107
*
114
- * @return array|null The class descriptions or null, if the file was empty
108
+ * @return array The class descriptions
115
109
*
116
110
* @throws \InvalidArgumentException If the file could not be loaded or did
117
111
* not contain a YAML array
@@ -126,7 +120,7 @@ private function parseFile($path)
126
120
127
121
// empty file
128
122
if (null === $ classes ) {
129
- return ;
123
+ return array () ;
130
124
}
131
125
132
126
// not an array
Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ public function testLoadClassMetadataReturnsFalseIfEmpty()
31
31
$ metadata = new ClassMetadata ('Symfony\Component\Validator\Tests\Fixtures\Entity ' );
32
32
33
33
$ this ->assertFalse ($ loader ->loadClassMetadata ($ metadata ));
34
+
35
+ $ r = new \ReflectionProperty ($ loader , 'classes ' );
36
+ $ r ->setAccessible (true );
37
+ $ this ->assertSame (array (), $ r ->getValue ($ loader ));
34
38
}
35
39
36
40
/**
You can’t perform that action at this time.
0 commit comments