Permalink
Browse files

[Event] Collected data is about listener (not event) calls

  • Loading branch information...
1 parent 08c3a2b commit 9a2e053cbc841d02baa13b15805e0b1af7a1884e @vicb vicb committed with fabpot Jan 9, 2011
@@ -39,11 +39,7 @@ public function __construct(LoggerInterface $logger = null)
}
/**
- * Notifies all listeners of a given event.
- *
- * @param Event $event A Event instance
- *
- * @return Event The Event instance
+ * {@inheritDoc}
*/
public function notify(Event $event)
{
@@ -57,11 +53,7 @@ public function notify(Event $event)
}
/**
- * Notifies all listeners of a given event until one returns a non null value.
- *
- * @param Event $event A Event instance
- *
- * @return Event The Event instance
+ * {@inheritDoc}
*/
public function notifyUntil(Event $event)
{
@@ -87,12 +79,7 @@ public function notifyUntil(Event $event)
}
/**
- * Filters a value by calling all listeners of a given event.
- *
- * @param Event $event A Event instance
- * @param mixed $value The value to be filtered
- *
- * @return Event The Event instance
+ * {@inheritDoc}
*/
public function filter(Event $event, $value)
{
@@ -107,12 +94,18 @@ public function filter(Event $event, $value)
return $event;
}
- public function getCalledEvents()
+ /**
+ * {@inheritDoc}
+ */
+ public function getCalledListeners()
{
return $this->called;
}
- public function getNotCalledEvents()
+ /**
+ * {@inheritDoc}
+ */
+ public function getNotCalledListeners()
{
$notCalled = array();
@@ -6,35 +6,35 @@ Events
{% endblock %}
{% block panel %}
- <h2>Called Events</h2>
+ <h2>Called Listeners</h2>
<table>
<tr>
<th>Event</th>
<th>Caller</th>
<th>Listener</th>
</tr>
- {% for event in collector.calledevents %}
+ {% for elements in collector.calledlisteners %}
<tr>
- <td><code>{{ event.event }}</code></td>
- <td><code>{{ event.caller|abbr_class }}</code></td>
- <td><code>{{ event.listener|abbr_method }}()</code></td>
+ <td><code>{{ elements.event }}</code></td>
+ <td><code>{{ elements.caller|abbr_class }}</code></td>
+ <td><code>{{ elements.listener|abbr_method }}()</code></td>
</tr>
{% endfor %}
</table>
- {% if collector.notcalledevents %}
- <h2>Not Called Events</h2>
+ {% if collector.notcalledlisteners %}
+ <h2>Not Called Listeners</h2>
<table>
<tr>
<th>Event</th>
<th>Listener</th>
</tr>
- {% for event in collector.notcalledevents %}
+ {% for elements in collector.notcalledlisteners %}
<tr>
- <td><code>{{ event.event }}</code></td>
- <td><code>{{ event.listener|abbr_method }}()</code></td>
+ <td><code>{{ elements.event }}</code></td>
+ <td><code>{{ elements.listener|abbr_method }}()</code></td>
</tr>
{% endfor %}
</table>
@@ -38,33 +38,33 @@ public function setEventDispatcher(EventDispatcher $dispatcher)
public function collect(Request $request, Response $response, \Exception $exception = null)
{
$this->data = array(
- 'called_events' => null !== $this->dispatcher ? $this->dispatcher->getCalledEvents() : array(),
- 'not_called_events' => null !== $this->dispatcher ? $this->dispatcher->getNotCalledEvents() : array(),
+ 'called_listeners' => null !== $this->dispatcher ? $this->dispatcher->getCalledListeners() : array(),
+ 'not_called_listeners' => null !== $this->dispatcher ? $this->dispatcher->getNotCalledListeners() : array(),
);
}
/**
- * Gets the called events.
+ * Gets the called listeners.
*
- * @return array An array of called events
+ * @return array An array of called listeners
*
* @see EventDispatcherTraceableInterface
*/
- public function getCalledEvents()
+ public function getCalledListeners()
{
- return $this->data['called_events'];
+ return $this->data['called_listeners'];
}
/**
- * Gets the not called events.
+ * Gets the not called listeners.
*
- * @return array An array of not called events
+ * @return array An array of not called listeners
*
* @see EventDispatcherTraceableInterface
*/
- public function getNotCalledEvents()
+ public function getNotCalledListeners()
{
- return $this->data['not_called_events'];
+ return $this->data['not_called_listeners'];
}
/**
@@ -16,7 +16,17 @@
*/
interface EventDispatcherTraceableInterface
{
- function getCalledEvents();
+ /**
+ * Gets the called listeners.
+ *
+ * @return array An array of called listeners
+ */
+ function getCalledListeners();
- function getNotCalledEvents();
+ /**
+ * Gets the not called listeners.
+ *
+ * @return array An array of not called listeners
+ */
+ function getNotCalledListeners();
}

0 comments on commit 9a2e053

Please sign in to comment.