Skip to content

Commit 4da8de0

Browse files
authored
Reduce potential confusion in priority explanation
I always get tripped up by event priority. In my mind, I think priority 1 executes before priority 2. I'm backwards, I know... This PR should help remove any confusion for myself and others by explicitly stating "priority 3 executes before priority 2" and so on.
1 parent 06b1ee6 commit 4da8de0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

components/event_dispatcher.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ The ``addListener()`` method takes up to three arguments:
147147

148148
#. The event name (string) that this listener wants to listen to;
149149
#. A PHP callable that will be executed when the specified event is dispatched;
150-
#. An optional priority integer (higher equals more important and therefore
151-
that the listener will be triggered earlier) that determines when a listener
152-
is triggered versus other listeners (defaults to ``0``). If two listeners
153-
have the same priority, they are executed in the order that they were
154-
added to the dispatcher.
150+
#. An optional priority integer that determines when a listener is triggered
151+
versus other listeners (defaults to ``0``). A higher priority integer means
152+
the listener will be triggered earlier. So, priority 3 executes before
153+
priority 2. Priority 2 executes before priority 1. Priority 1 executes before
154+
priority 0, and so on. If two listeners have the same priority, they are
155+
executed in the order that they were added to the dispatcher.
155156

156157
.. note::
157158

0 commit comments

Comments
 (0)