Skip to content

Mark all dispatched event classes as final #33152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Symfony/Component/Console/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ CHANGELOG
* added `Question::setTrimmable` default to true to allow the answer to be trimmed
* added method `preventRedrawFasterThan()` and `forceRedrawSlowerThan()` on `ProgressBar`
* `Application` implements `ResetInterface`
* marked all dispatched event classes as `@final`

4.3.0
-----
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Console/Event/ConsoleCommandEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Allows to do things before the command is executed, like skipping the command or changing the input.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @final since Symfony 4.4
*/
class ConsoleCommandEvent extends ConsoleEvent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Allows to manipulate the exit code of a command after its execution.
*
* @author Francesco Levorato <git@flevour.net>
*
* @final since Symfony 4.4
*/
class ConsoleTerminateEvent extends ConsoleEvent
{
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Form/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CHANGELOG
* deprecated using `int` or `float` as data for the `NumberType` when the `input` option is set to `string`
* The type guesser guesses the HTML accept attribute when a mime type is configured in the File or Image constraint.
* Overriding the methods `FormIntegrationTestCase::setUp()`, `TypeTestCase::setUp()` and `TypeTestCase::tearDown()` without the `void` return-type is deprecated.
* marked all dispatched event classes as `@final`

4.3.0
-----
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/Event/PostSetDataEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* This event is dispatched at the end of the Form::setData() method.
*
* This event is mostly here for reading data after having pre-populated the form.
*
* @final since Symfony 4.4
*/
class PostSetDataEvent extends FormEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/Event/PostSubmitEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* once the model and view data have been denormalized.
*
* It can be used to fetch data after denormalization.
*
* @final since Symfony 4.4
*/
class PostSubmitEvent extends FormEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/Event/PreSetDataEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* It can be used to:
* - Modify the data given during pre-population;
* - Modify a form depending on the pre-populated data (adding or removing fields dynamically).
*
* @final since Symfony 4.4
*/
class PreSetDataEvent extends FormEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/Event/PreSubmitEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* It can be used to:
* - Change data from the request, before submitting the data to the form.
* - Add or remove form fields, before submitting the data to the form.
*
* @final since Symfony 4.4
*/
class PreSubmitEvent extends FormEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/Form/Event/SubmitEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* transforms back the normalized data to the model and view data.
*
* It can be used to change data from the normalized representation of the data.
*
* @final since Symfony 4.4
*/
class SubmitEvent extends FormEvent
{
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/HttpKernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ CHANGELOG
fallback directories. Resources like service definitions are usually loaded relative to the
current directory or with a glob pattern. The fallback directories have never been advocated
so you likely do not use those in any app based on the SF Standard or Flex edition.
* Marked all dispatched event classes as `@final`

4.3.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* controller.
*
* @author Christophe Coevoet <stof@notk.org>
*
* @final since Symfony 4.4
*/
class ControllerArgumentsEvent extends FilterControllerArgumentsEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/Event/ControllerEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Controllers should be callables.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @final since Symfony 4.4
*/
class ControllerEvent extends FilterControllerEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/Event/ExceptionEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* event.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @final since Symfony 4.4
*/
class ExceptionEvent extends GetResponseForExceptionEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/Event/FinishRequestEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* Triggered whenever a request is fully processed.
*
* @author Benjamin Eberlei <kontakt@beberlei.de>
*
* @final since Symfony 4.4
*/
class FinishRequestEvent extends KernelEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/Event/ResponseEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* browser.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @final since Symfony 4.4
*/
class ResponseEvent extends FilterResponseEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/Event/TerminateEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* will always return the value of `HttpKernelInterface::MASTER_REQUEST`.
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*
* @final since Symfony 4.4
*/
class TerminateEvent extends PostResponseEvent
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/HttpKernel/Event/ViewEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* response is set.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @final since Symfony 4.4
*/
class ViewEvent extends GetResponseForControllerResultEvent
{
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Mailer/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ CHANGELOG
`Symfony\Component\Mailer\Transport\TransportFactoryInterface` and tagging with `mailer.transport_factory` tag in DI.
* Added `Symfony\Component\Mailer\Test\TransportFactoryTestCase` to ease testing custom transport factories.
* Added `SentMessage::getDebug()` and `TransportExceptionInterface::getDebug` to help debugging
* Made `MessageEvent` final

4.3.0
-----
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Mailer/Event/MessageEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class MessageEvent extends Event
final class MessageEvent extends Event
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabpot there is a MessageEvents class in the same mailer namespace. This can easily be confused with the event class and should maybe be renamed or relocated or even made internal.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't MessageEvents the class holding all event names as constants ? This is not internal

Copy link
Contributor Author

@Tobion Tobion Aug 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Mailer MessageEvents is a class used for logging and data collecting. It collects events but is not an event itself.

{
private $message;
private $envelope;
Expand Down
1 change: 1 addition & 0 deletions src/Symfony/Component/Messenger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CHANGELOG
pass a `RoutableMessageBus` instance instead.
* Added support for auto trimming of Redis streams.
* `InMemoryTransport` handle acknowledged and rejected messages.
* Made all dispatched worker event classes final.

4.3.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @author Ryan Weaver <ryan@symfonycasts.com>
*/
class SendMessageToTransportsEvent
final class SendMessageToTransportsEvent
{
private $envelope;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The event name is the class name.
*/
class WorkerMessageFailedEvent extends AbstractWorkerMessageEvent
final class WorkerMessageFailedEvent extends AbstractWorkerMessageEvent
{
private $throwable;
private $willRetry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* The event name is the class name.
*/
class WorkerMessageHandledEvent extends AbstractWorkerMessageEvent
final class WorkerMessageHandledEvent extends AbstractWorkerMessageEvent
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* The event name is the class name.
*/
class WorkerMessageReceivedEvent extends AbstractWorkerMessageEvent
final class WorkerMessageReceivedEvent extends AbstractWorkerMessageEvent
{
private $shouldHandle = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
*
* @author Robin Chalas <robin.chalas@gmail.com>
*/
class WorkerStoppedEvent
final class WorkerStoppedEvent
{
}
1 change: 1 addition & 0 deletions src/Symfony/Component/Security/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CHANGELOG
* Added and implemented `PasswordUpgraderInterface`, for opportunistic password migrations
* Added `Guard\PasswordAuthenticatedInterface`, an optional interface
for "guard" authenticators that deal with user passwords
* Marked all dispatched event classes as `@final`

4.3.0
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* This event is dispatched on authentication failure.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*
* @final since Symfony 4.4
*/
class AuthenticationFailureEvent extends AuthenticationEvent
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Security\Core\Event;

/**
* @final since Symfony 4.4
*/
class AuthenticationSuccessEvent extends AuthenticationEvent
{
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Security/Core/Event/VoteEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*
* @internal
*/
class VoteEvent extends Event
final class VoteEvent extends Event
{
private $voter;
private $subject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* Deauthentication happens in case the user has changed when trying to refresh the token.
*
* @author Hamza Amrouche <hamza.simperfit@gmail.com>
*
* @final since Symfony 4.4
*/
class DeauthenticatedEvent extends Event
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

/**
* @author Fabien Potencier <fabien@symfony.com>
*
* @final since Symfony 4.4
*/
class InteractiveLoginEvent extends Event
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* SwitchUserEvent.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @final since Symfony 4.4
*/
class SwitchUserEvent extends Event
{
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/Workflow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.4.0
-----

* Marked all dispatched event classes as `@final`

4.3.0
-----

Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/Workflow/Event/AnnounceEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Workflow\Event;

/**
* @final since Symfony 4.4
*/
class AnnounceEvent extends Event
{
}
3 changes: 3 additions & 0 deletions src/Symfony/Component/Workflow/Event/CompletedEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Workflow\Event;

/**
* @final since Symfony 4.4
*/
class CompletedEvent extends Event
{
}
3 changes: 3 additions & 0 deletions src/Symfony/Component/Workflow/Event/EnterEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Workflow\Event;

/**
* @final since Symfony 4.4
*/
class EnterEvent extends Event
{
}
3 changes: 3 additions & 0 deletions src/Symfony/Component/Workflow/Event/EnteredEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Workflow\Event;

/**
* @final since Symfony 4.4
*/
class EnteredEvent extends Event
{
}
2 changes: 2 additions & 0 deletions src/Symfony/Component/Workflow/Event/GuardEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
/**
* @author Fabien Potencier <fabien@symfony.com>
* @author Grégoire Pineau <lyrixx@lyrixx.info>
*
* @final since Symfony 4.4
*/
class GuardEvent extends Event
{
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Component/Workflow/Event/LeaveEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Workflow\Event;

/**
* @final since Symfony 4.4
*/
class LeaveEvent extends Event
{
}
3 changes: 3 additions & 0 deletions src/Symfony/Component/Workflow/Event/TransitionEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

namespace Symfony\Component\Workflow\Event;

/**
* @final since Symfony 4.4
*/
class TransitionEvent extends Event
{
private $context;
Expand Down