Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f6ae18e

Browse filesBrowse files
minor #36710 [DI][EventDispatcher] added contract for implementation (bestform)
This PR was merged into the 3.4 branch. Discussion ---------- [DI][EventDispatcher] added contract for implementation | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #36708 | License | MIT As described in the attached issue a comment in the documentation of the `EventSubscriberInterface` would be helpful to make sure users do not use logic based on runtime state in their implementation of `getSubscribedEvents`. Commits ------- 88e43d4 [DI][EventDispatcher] added contract for implementation
2 parents 94482fe + 88e43d4 commit f6ae18e
Copy full SHA for f6ae18e

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/EventDispatcher/EventSubscriberInterface.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ interface EventSubscriberInterface
4040
* * ['eventName' => ['methodName', $priority]]
4141
* * ['eventName' => [['methodName1', $priority], ['methodName2']]]
4242
*
43+
* The code must not depend on runtime state as it will only be called at compile time.
44+
* All logic depending on runtime state must be put into the individual methods handling the events.
45+
*
4346
* @return array The event names to listen to
4447
*/
4548
public static function getSubscribedEvents();

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.