-
Notifications
You must be signed in to change notification settings - Fork 6
/
event_dispatcher_and_kernel_events.yaml
306 lines (306 loc) · 16.9 KB
/
event_dispatcher_and_kernel_events.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
questions:
-
uuid: 1eebf878-8b96-6eea-8d09-99d84c92580c
question: 'In which order does Symfony trigger the following events?'
answers:
- { value: 'kernel.request, kernel.controller, kernel.controller_arguments, kernel.view, kernel.response, kernel.finish_request, kernel.terminate', correct: true }
- { value: 'kernel.request, kernel.controller, kernel.controller_arguments, kernel.view, kernel.response, kernel.terminate, kernel.finish_request', correct: false }
- { value: 'kernel.request, kernel.controller, kernel.controller_arguments, kernel.response, kernel.view, kernel.terminate, kernel.finish_request', correct: false }
- { value: 'kernel.request, kernel.controller, kernel.controller_arguments, kernel.response, kernel.view, kernel.finish_request, kernel.terminate', correct: false }
help: 'https://symfony.com/doc/current/components/http_kernel.html#creating-an-event-listener'
-
uuid: 1eebf878-8b97-658e-8993-99d84c92580c
question: 'What is the argument passed to listeners of kernel.finish_request?'
answers:
- { value: RequestEvent, correct: false }
- { value: GetResponseEvent, correct: false }
- { value: ResponseEvent, correct: false }
- { value: FinishRequestEvent, correct: true }
- { value: PostResponseEvent, correct: false }
help: 'https://symfony.com/doc/current/components/http_kernel.html#creating-an-event-listener'
-
uuid: 1eebf878-8b98-66fa-a25e-99d84c92580c
question: 'Could an event be dispatched without creating a custom event class?'
answers:
- { value: 'No', correct: false }
- { value: 'Yes', correct: true }
help: 'https://symfony.com/doc/current/components/event_dispatcher/generic_event.html'
-
uuid: 1eebf878-8b98-67cc-b162-99d84c92580c
question: 'Which method is to be implemented from a ServiceSubscriberInterface?'
answers:
- { value: 'public static function addSubscribedService()', correct: false }
- { value: 'public static function setSubscribedServices()', correct: false }
- { value: 'public static function getSubscribedServices()', correct: true }
- { value: 'public function setSubscribedServices()', correct: false }
help: 'https://github.com/symfony/symfony/blob/6.3/src/Symfony/Contracts/Service/ServiceSubscriberInterface.php'
-
uuid: 1eebf878-8b98-68f8-b15f-99d84c92580c
question: 'Which exception is throw when trying to add a subscriber into an ImmutableEventDispatcher?'
answers:
- { value: LogicException, correct: false }
- { value: InvalidArgumentException, correct: false }
- { value: BadMethodCallException, correct: true }
- { value: RuntimeException, correct: false }
- { value: FrozenEventDispatcherException, correct: false }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eebf878-8b99-66cc-8a0a-99d84c92580c
question: 'What is the aim of the Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse() listener on kernel.response event?'
answers:
- { value: 'Checks if the Response has a body.', correct: false }
- { value: 'Checks if the Response headers match the HTTP RFC requirements.', correct: false }
- { value: 'Sets the Response headers based on the Request.', correct: true }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/HttpKernel/EventListener/ResponseListener.php'
-
uuid: 1eebf878-8b99-6762-af2d-99d84c92580c
question: 'Which design pattern does the EventDispatcher component implement?'
answers:
- { value: Strategy, correct: false }
- { value: 'Factory Method', correct: false }
- { value: Mediator, correct: true }
- { value: Adapter, correct: false }
help: 'https://symfony.com/doc/current/components/event_dispatcher/introduction.html#introduction'
-
uuid: 1eebf878-8b99-69ec-a934-99d84c92580c
question: 'What is the aim of the FragmentListener::onKernelRequest() listener on kernel.request event?'
answers:
- { value: 'Handle as content all files to let user download them.', correct: false }
- { value: 'Handle as content all image, css, javascript that not require security.', correct: false }
- { value: 'Handle as content all image, css, javascript that require security.', correct: false }
- { value: 'Handle as content fragments by this listener all URL paths starting with /_fragment.', correct: true }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php'
-
uuid: 1eebf878-8b9a-6388-aaa8-99d84c92580c
question: 'Could subscribers be removed from an ImmutableEventDispatcher?'
answers:
- { value: 'Yes', correct: false }
- { value: 'No', correct: true }
help: 'https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eebf878-8b9a-6bc6-aaa0-99d84c92580c
question: 'What is the tag to use to listen to different events/hooks in Symfony?'
answers:
- { value: dispatcher.event_listener, correct: false }
- { value: kernel.listener, correct: false }
- { value: event_dispatcher.event_listener, correct: false }
- { value: event_listener, correct: false }
- { value: dispatcher.listener, correct: false }
- { value: kernel.event_listener, correct: true }
help: 'https://symfony.com/doc/current/reference/dic_tags.html#kernel-event-listener'
-
uuid: 1eebf878-8b9b-6ab2-ba48-99d84c92580c
question: 'Could the event listeners related to an event be retrieved from the ImmutableEventDispatcher?'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eebf878-8b9c-65b6-a29a-99d84c92580c
question: 'Could listeners be removed from an ImmutableEventDispatcher?'
answers:
- { value: 'Yes', correct: false }
- { value: 'No', correct: true }
help: 'https://github.com/symfony/symfony/blob/6.3/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eebf878-8b9c-67dc-894b-99d84c92580c
question: 'Could new listeners be added to an ImmutableEventDispatcher?'
answers:
- { value: 'Yes', correct: false }
- { value: 'No', correct: true }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eebf878-8b9d-6380-81e4-99d84c92580c
question: 'Is the following code valid?php bin/console debug:event-dispatcher kernel'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/current/event_dispatcher.html#debugging-event-listeners'
-
uuid: 1eebf878-8b9d-6876-a57d-99d84c92580c
question: 'What is the argument passed to listeners of kernel.exception?'
answers:
- { value: ResponseEvent, correct: false }
- { value: PostExceptionEvent, correct: false }
- { value: ExceptionEvent, correct: true }
- { value: PostResponseEvent, correct: false }
- { value: GetResponseExceptionEvent, correct: false }
- { value: FilterExceptionEvent, correct: false }
help: 'https://symfony.com/doc/current/components/http_kernel.html#creating-an-event-listener'
-
uuid: 1eebf878-8b9d-6a9c-aea4-99d84c92580c
question: 'Which design pattern implements the EventDispatcher component?'
answers:
- { value: Adapter, correct: false }
- { value: Decorator, correct: false }
- { value: Observer, correct: true }
- { value: Mediator, correct: true }
help: 'https://symfony.com/doc/current/components/event_dispatcher.html#introduction'
-
uuid: 1eebf878-8b9d-6b32-ad5b-99d84c92580c
question: 'Which method from EventSubscriberInterface return array of events that subscriber wants to listen to?'
answers:
- { value: getEvents(), correct: false }
- { value: getSubscribedEvents(), correct: true }
- { value: getSubscribed(), correct: false }
- { value: getSubscribedEventsList(), correct: false }
help: 'https://symfony.com/doc/current/event_dispatcher.html#creating-an-event-subscriber'
-
uuid: 1eebf878-8b9d-6b82-8ebf-99d84c92580c
question: 'Which method from Symfony\Contracts\EventDispatcher\EventDispatcherInterface forwarding an event to all registered listeners?'
answers:
- { value: 'dispatch(object $event, string $eventName = null): object', correct: true }
- { value: 'send(object $event, string $eventName = null): object', correct: false }
- { value: 'fire(object $event, string $eventName = null): object', correct: false }
- { value: 'sendOff(object $event, string $eventName = null): object', correct: false }
help: 'https://symfony.com/doc/current/components/event_dispatcher.html#dispatch-the-event'
-
uuid: 1eebf878-8b9d-6bd2-98fc-99d84c92580c
question: 'Which method of the Symfony\Component\EventDispatcher\EventDispatcherInterface belongs to its parent Symfony\Contracts\EventDispatcher\EventDispatcherInterface'
answers:
- { value: 'dispatch(object $event, string $eventName = null): object', correct: true }
- { value: 'addListener(string $eventName, $listener, int $priority = 0)', correct: false }
- { value: 'hasListeners(string $eventName = null)', correct: false }
- { value: 'removeListener(string $eventName, $listener)', correct: false }
help: 'https://github.com/symfony/event-dispatcher-contracts/blob/main/EventDispatcherInterface.php'
-
uuid: 1eebf878-8b9d-6c22-975b-99d84c92580c
question: 'Which method allows to prevent any other Event listeners from being called?'
answers:
- { value: stopPropagation(), correct: true }
- { value: preventDefault(), correct: false }
- { value: stop(), correct: false }
- { value: off(), correct: false }
help: 'https://symfony.com/doc/current/components/event_dispatcher.html#stopping-event-flow-propagation'
-
uuid: 1eebf878-8b9d-6c72-9bfc-99d84c92580c
question: 'Is it possible to detect if an Event was stopped during runtime?'
answers:
- { value: 'no', correct: false }
- { value: 'yes', correct: true }
- { value: 'yes, but not always', correct: false }
- { value: 'yes, but only once', correct: false }
help: 'https://symfony.com/doc/current/components/event_dispatcher.html#stopping-event-flow-propagation'
-
uuid: 1eebf878-8b9d-6d62-a4f1-99d84c92580c
question: 'Instantiating a new Kernel, what is the correct arguments order?'
answers:
- { value: 'public function __construct(string $environment, bool $debug)', correct: true }
- { value: 'public function __construct(bool $debug, string $environment)', correct: false }
- { value: 'public function __construct(string $name, string $environment, bool $debug)', correct: false }
- { value: 'public function __construct(string $environment, bool $debug, string $name = null)', correct: false }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/HttpKernel/Kernel.php'
-
uuid: 1eebf878-8b9d-6ee8-af09-99d84c92580c
question: 'Which kernel event exist ?'
answers:
- { value: kernel.request, correct: true }
- { value: kernel.controller, correct: true }
- { value: kernel.template, correct: false }
- { value: kernel.view, correct: true }
- { value: kernel.response, correct: true }
- { value: kernel.answer, correct: false }
- { value: kernel.finish_request, correct: true }
- { value: kernel.start_request, correct: false }
- { value: kernel.terminate, correct: true }
- { value: kernel.start, correct: false }
- { value: kernel.exception, correct: true }
help: 'https://symfony.com/doc/current/components/http_kernel.html#creating-an-event-listener'
-
uuid: 1eebf878-8ba1-6e08-b1a3-99d84c92580c
question: 'Could a button receive an event listener?'
answers:
- { value: 'Yes', correct: false }
- { value: 'No', correct: true }
help: 'https://github.com/symfony/symfony/blob/2.3/src/Symfony/Component/Form/ButtonBuilder.php#L176'
-
uuid: 1eebf878-8ba2-63ee-a965-99d84c92580c
question: 'What is the third argument of the handle method in the HttpKernelInterface?'
answers:
- { value: 'The name of the environment', correct: false }
- { value: 'A Request instance', correct: false }
- { value: 'Whether to activate the debug or not', correct: false }
- { value: 'Whether to catch exceptions or not', correct: true }
- { value: 'The type of the request', correct: false }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/HttpKernel/HttpKernel.php#L69'
-
uuid: 1eebf878-8ba2-66be-8489-99d84c92580c
question: 'What is the argument passed to listeners of kernel.exception?'
answers:
- { value: FilterExceptionEvent, correct: false }
- { value: PostExceptionEvent, correct: false }
- { value: GetResponseExceptionEvent, correct: false }
- { value: ExceptionEvent, correct: true }
- { value: ResponseEvent, correct: false }
- { value: PostResponseEvent, correct: false }
help: 'https://symfony.com/doc/current/components/http_kernel.html#creating-an-event-listener'
-
uuid: 1eebf878-8ba2-67ae-9387-99d84c92580c
question: 'From an Event instance, is it possible to get the EventDispatcher instance that dispatched this event?'
answers:
- { value: 'Yes', correct: false }
- { value: 'No', correct: true }
help: 'https://symfony.com/doc/current/components/event_dispatcher.html#event-name-introspection'
-
uuid: 1eebf878-8ba3-6032-bdaf-99d84c92580c
question: 'Which exception is throw when trying to remove a listener from an ImmutableEventDispatcher?'
answers:
- { value: RuntimeException, correct: false }
- { value: LogicException, correct: false }
- { value: InvalidArgumentException, correct: false }
- { value: BadMethodCallException, correct: true }
- { value: FrozenEventDispatcherException, correct: false }
help: 'https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eebf878-8ba3-69c4-a0e8-99d84c92580c
question: 'Could new subscribers be added to an ImmutableEventDispatcher?'
answers:
- { value: 'No', correct: true }
- { value: 'Yes', correct: false }
help: 'https://github.com/symfony/symfony/blob/7.2/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eebf878-8ba4-604a-9e4b-99d84c92580c
question: 'What is the tag to use to subscribe to a set of different events/hooks in Symfony?'
answers:
- { value: dispatcher.subscriber, correct: false }
- { value: event_subscriber, correct: false }
- { value: kernel.subscriber, correct: false }
- { value: event_dispatcher.event_subscriber, correct: false }
- { value: dispatcher.event_subscriber, correct: false }
- { value: kernel.event_subscriber, correct: true }
help: 'https://symfony.com/doc/current/reference/dic_tags.html#kernel-event-subscriber'
-
uuid: 1eebf878-8ba4-6b12-9f65-99d84c92580c
question: 'Could the non-called listeners be retrieved per event when using the TraceableEventDispatcher?'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/7.1/components/event_dispatcher/traceable_dispatcher.html'
-
uuid: 1eebf878-8ba4-6bf8-a2d4-99d84c92580c
question: 'Could the called listeners be retrieved per event when using the TraceableEventDispatcher?'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/current/components/event_dispatcher/traceable_dispatcher.html'
-
uuid: 1eebf878-8ba7-6330-b557-99d84c92580c
question: 'Is it possible to set a priority when there are several EventListener on an event?'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://symfony.com/doc/current/components/event_dispatcher/introduction.html#connecting-listeners'
-
uuid: 1eed573c-948f-6bd6-816f-b14ed863ed41
question: 'Could the event dispatcher be transformed into a read-only proxy?'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://github.com/symfony/symfony/blob/2.1/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'
-
uuid: 1eee76b6-6968-64a4-9026-a9f053a22e31
question: 'Could the existence of an event listener be checked from within the ImmutableEventDispatcher?'
answers:
- { value: 'Yes', correct: true }
- { value: 'No', correct: false }
help: 'https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php'