Skip to content

Commit

Permalink
[WebProfilerBundle][FrameworkBundle]Fixed events panel to handle clos…
Browse files Browse the repository at this point in the history
…ures correctly
  • Loading branch information
hidenorigoto authored and fabpot committed Feb 10, 2011
1 parent a8ec9b2 commit 82a8a3f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Expand Up @@ -78,12 +78,19 @@ public function abbrClass($class)

public function abbrMethod($method)
{
list($class, $method) = explode('::', $method);

$parts = explode('\\', $class);
$short = array_pop($parts);
if (false !== strpos($method, '::')) {
list($class, $method) = explode('::', $method);

$parts = explode('\\', $class);
$short = array_pop($parts);
$result = sprintf("<abbr title=\"%s\">%s</abbr>::%s()", $class, $short, $method);
} else if ('Closure' === $method) {
$result = sprintf("<abbr title=\"%s\">%s</abbr>", $method, $method);
} else {
$result = sprintf("<abbr title=\"%s\">%s</abbr>()", $method, $method);
}

return sprintf("<abbr title=\"%s\">%s</abbr>::%s", $class, $short, $method);
return $result;
}

/**
Expand Down
Expand Up @@ -18,7 +18,7 @@ Events
<tr>
<td><code>{{ elements.event }}</code></td>
<td><code>{{ elements.caller|abbr_class }}</code></td>
<td><code>{{ elements.listener|abbr_method }}()</code></td>
<td><code>{{ elements.listener|abbr_method }}</code></td>
</tr>
{% endfor %}
</table>
Expand All @@ -34,7 +34,7 @@ Events
{% for elements in collector.notcalledlisteners %}
<tr>
<td><code>{{ elements.event }}</code></td>
<td><code>{{ elements.listener|abbr_method }}()</code></td>
<td><code>{{ elements.listener|abbr_method }}</code></td>
</tr>
{% endfor %}
</table>
Expand Down

0 comments on commit 82a8a3f

Please sign in to comment.