44The Generic Event Object
55========================
66
7- The base :class: `Symfony\\ Component\\ EventDispatcher\\ Event ` class provided by the
8- EventDispatcher component is deliberately sparse to allow the creation of
9- API specific event objects by inheritance using OOP. This allows for elegant and
10- readable code in complex applications.
7+ The base :class: `Symfony\\ Component\\ EventDispatcher\\ Event ` class provided
8+ by the EventDispatcher component is deliberately sparse to allow the creation
9+ of API specific event objects by inheritance using OOP. This allows for
10+ elegant and readable code in complex applications.
1111
1212The :class: `Symfony\\ Component\\ EventDispatcher\\ GenericEvent ` is available
13- for convenience for those who wish to use just one event object throughout their
14- application. It is suitable for most purposes straight out of the box, because
15- it follows the standard observer pattern where the event object
13+ for convenience for those who wish to use just one event object throughout
14+ their application. It is suitable for most purposes straight out of the
15+ box, because it follows the standard observer pattern where the event object
1616encapsulates an event 'subject', but has the addition of optional extra
1717arguments.
1818
19- :class: `Symfony\\ Component\\ EventDispatcher\\ GenericEvent ` has a simple API in
20- addition to the base class :class: `Symfony\\ Component\\ EventDispatcher\\ Event `
19+ :class: `Symfony\\ Component\\ EventDispatcher\\ GenericEvent ` has a simple
20+ API in addition to the base class
21+ :class: `Symfony\\ Component\\ EventDispatcher\\ Event `
2122
2223* :method: `Symfony\\ Component\\ EventDispatcher\\ GenericEvent::__construct `:
2324 Constructor takes the event subject and any arguments;
@@ -41,8 +42,8 @@ addition to the base class :class:`Symfony\\Component\\EventDispatcher\\Event`
4142 Returns true if the argument key exists;
4243
4344The ``GenericEvent `` also implements :phpclass: `ArrayAccess ` on the event
44- arguments which makes it very convenient to pass extra arguments regarding the
45- event subject.
45+ arguments which makes it very convenient to pass extra arguments regarding
46+ the event subject.
4647
4748The following examples show use-cases to give a general idea of the flexibility.
4849The examples assume event listeners have been added to the dispatcher.
@@ -64,8 +65,8 @@ Simply passing a subject::
6465 }
6566 }
6667
67- Passing and processing arguments using the :phpclass: `ArrayAccess ` API to access
68- the event arguments::
68+ Passing and processing arguments using the :phpclass: `ArrayAccess ` API to
69+ access the event arguments::
6970
7071 use Symfony\Component\EventDispatcher\GenericEvent;
7172
0 commit comments