8000 minor #35440 Sort the KernelEvents constants to match the lifecycle o… · symfony/symfony@e493752 · GitHub
[go: up one dir, main page]

Skip to content

Commit e493752

Browse files
committed
minor #35440 Sort the KernelEvents constants to match the lifecycle of the framework (hermann8u)
This PR was squashed before being merged into the 5.1-dev branch (closes #35440). Discussion ---------- Sort the KernelEvents constants to match the lifecycle of the framework | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - | License | MIT | Doc PR | - This PR is the same as #35248 but on the correct branch this time! > Hi, > > When I need to visualize all the kernel events I often open the KernelEvents file. However, it is difficult to navigate through it because the constants are not in the same order compared to the framework execution life cycle. > > This PR aims to sort this constants to match it. It's also the same order used in [this documentation page](https://symfony.com/doc/current/reference/events.html). > > Thanks. Commits ------- a447cba Sort the KernelEvents constants to match the lifecycle of the framework
2 parents 8b337fc + a447cba commit e493752

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/Symfony/Component/HttpKernel/KernelEvents.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,6 @@ final class KernelEvents
3939
*/
4040
const EXCEPTION = 'kernel.exception';
4141

42-
/**
43-
* The VIEW event occurs when the return value of a controller
44-
* is not a Response instance.
45-
*
46-
* This event allows you to create a response for the return value of the
47-
* controller.
48-
*
49-
* @Event("Symfony\Component\HttpKernel\Event\ViewEvent")
50-
*/
51-
const VIEW = 'kernel.view';
52-
5342
/**
5443
* The CONTROLLER event occurs once a controller was found for
5544
* handling a request.
@@ -71,6 +60,17 @@ final class KernelEvents
7160
*/
7261
const CONTROLLER_ARGUMENTS = 'kernel.controller_arguments';
7362

63+
/**
64+
* The VIEW event occurs when the return value of a controller
65+
* is not a Response instance.
66+
*
67+
* This event allows you to create a response for the return value of the
68+
* controller.
69+
*
70+
* @Event("Symfony\Component\HttpKernel\Event\ViewEvent")
71+
*/
72+
const VIEW = 'kernel.view';
73+
7474
/**
7575
* The RESPONSE event occurs once a response was created for
7676
* replying to a request.
@@ -82,15 +82,6 @@ final class KernelEvents
8282
*/
8383
const RESPONSE = 'kernel.response';
8484

85-
/**
86-
* The TERMINATE event occurs once a response was sent.
87-
*
88-
* This event allows you to run expensive post-response jobs.
89-
*
90-
* @Event("Symfony\Component\HttpKernel\Event\TerminateEvent")
91-
*/
92-
const TERMINATE = 'kernel.terminate';
93-
9485
/**
9586
* The FINISH_REQUEST event occurs when a response was generated for a request.
9687
*
@@ -100,4 +91,13 @@ final class KernelEvents
10091
* @Event("Symfony\Component\HttpKernel\Event\FinishRequestEvent")
10192
*/
10293
const FINISH_REQUEST = 'kernel.finish_request';
94+
95+
/**
96+
* The TERMINATE event occurs once a response was sent.
97+
*
98+
* This event allows you to run expensive post-response jobs.
99+
*
100+
* @Event("Symfony\Component\HttpKernel\Event\TerminateEvent")
101+
*/
102+
const TERMINATE = 'kernel.terminate';
103103
}

0 commit comments

Comments
 (0)
0