Skip to content

Commit 3f9a253

Browse files
Cleanups
1 parent 06d75a7 commit 3f9a253

File tree

8 files changed

+21
-147
lines changed

8 files changed

+21
-147
lines changed

UPGRADE-3.2.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,6 @@ HttpKernel
4747
* `DataCollector::varToString()` is deprecated and will be removed in Symfony
4848
4.0. Use the `cloneVar()` method instead.
4949

50-
Before:
51-
52-
```php
53-
public function collect(Request $request, Response $response, \Exception $exception = null)
54-
{
55-
$this->data = [
56-
'something' => $this->varToString($request->attributes->get('...')),
57-
];
58-
}
59-
```
60-
61-
After:
62-
63-
```php
64-
public function collect(Request $request, Response $response, \Exception $exception = null)
65-
{
66-
$this->data = [
67-
'something' => $this->cloneVar($request->attributes->get('...')),
68-
];
69-
}
70-
```
71-
7250
Validator
7351
---------
7452

UPGRADE-4.0.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -134,28 +134,6 @@ HttpKernel
134134

135135
* The `DataCollector::varToString()` method has been removed in favor of `cloneVar()`.
136136

137-
Before:
138-
139-
```php
140-
public function collect(Request $request, Response $response, \Exception $exception = null)
141-
{
142-
$this->data = [
143-
'something' => $this->varToString($request->attributes->get('...')),
144-
];
145-
}
146-
```
147-
148-
After:
149-
150-
```php
151-
public function collect(Request $request, Response $response, \Exception $exception = null)
152-
{
153-
$this->data = [
154-
'something' => $this->cloneVar($request->attributes->get('...')),
155-
];
156-
}
157-
```
158-
159137
Serializer
160138
----------
161139

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/logger.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
<tr>
138138
<th>{{ show_level ? 'Level' : 'Time' }}</th>
139139
{% if channel_is_defined %}<th>Channel</th>{% endif %}
140-
<th style="width: 100%">Message</th>
140+
<th class="full-width">Message</th>
141141
</tr>
142142
</thead>
143143

@@ -158,7 +158,7 @@
158158
{% if channel_is_defined %}
159159
<td class="font-normal text-small text-bold" nowrap>
160160
{{ log.channel }}
161-
{% if log.errorCount is defined and log.errorCount > 0 %}
161+
{% if log.errorCount is defined and log.errorCount > 1 %}
162162
<span class="text-muted">({{ log.errorCount }} times)</span>
163163
{% endif %}
164164
</td>

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/profiler.css.twig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ table tbody ul {
184184
.block {
185185
display: block;
186186
}
187+
.full-width {
188+
width: 100%;
189+
}
187190
.hidden {
188191
display: none;
189192
}

src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerExtension.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @author Fabien Potencier <[email protected]>
2222
*/
23-
class WebProfilerExtension extends \Twig_Extension
23+
class WebProfilerExtension extends \Twig_Extension_Profiler
2424
{
2525
/**
2626
* @var ValueExporter
@@ -37,20 +37,27 @@ class WebProfilerExtension extends \Twig_Extension
3737
*/
3838
private $output;
3939

40+
/**
41+
* @var int
42+
*/
43+
private $stackLevel = 0;
44+
4045
public function __construct(HtmlDumper $dumper = null)
4146
{
4247
$this->dumper = $dumper ?: new HtmlDumper(null, null, HtmlDumper::DUMP_LIGHT_ARRAY);
43-
$this->reset();
48+
$this->dumper->setOutput($this->output = fopen('php://memory', 'r+b'));
4449
}
4550

46-
public function reset()
51+
public function enter(\Twig_Profiler_Profile $profile)
4752
{
48-
$this->dumper->setOutput($this->output = fopen('php://memory', 'r+b'));
53+
++$this->stackLevel;
4954
}
5055

51-
public function getNodeVisitors()
56+
public function leave(\Twig_Profiler_Profile $profile)
5257
{
53-
return array(new WebProfilerNodeVisitor($this->getName()));
58+
if (0 === --$this->stackLevel) {
59+
$this->dumper->setOutput($this->output = fopen('php://memory', 'r+b'));
60+
}
5461
}
5562

5663
/**

src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerNodeVisitor.php

Lines changed: 0 additions & 56 deletions
This file was deleted.

src/Symfony/Bundle/WebProfilerBundle/Twig/WebProfilerResetNode.php

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/Symfony/Component/HttpKernel/DataCollector/Util/ValueExporter.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@
1111

1212
namespace Symfony\Component\HttpKernel\DataCollector\Util;
1313

14+
@trigger_error('The '__NAMESPACE__.'\ValueExporter class is deprecated since version 3.2 and will be removed in 4.0. Use the VarDumper component instead.', E_USER_DEPRECATED);
15+
1416
/**
1517
* @author Bernhard Schussek <[email protected]>
1618
*
17-
* @deprecated Deprecated since version 3.2, to be removed in 4.0. Use the VarDumper component instead.
19+
* @deprecated since version 3.2, to be removed in 4.0. Use the VarDumper component instead.
1820
*/
1921
class ValueExporter
2022
{
21-
public function __construct()
22-
{
23-
@trigger_error(__CLASS__.' is deprecated since version 3.2 and will be removed in 4.0. Use the VarDumper component instead.', E_USER_DEPRECATED);
24-
}
25-
2623
/**
2724
* Converts a PHP value to a string.
2825
*

0 commit comments

Comments
 (0)