From 4530215af64b7bdf6d0c876b0a43b6b14df23e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Paris?= Date: Sat, 30 Nov 2024 11:01:53 +0100 Subject: [PATCH] Make final classes that can be This allows us to adapt to upstream changes without that being a breaking change. --- UPGRADE.md | 5 +++++ src/Command/LoadDataFixturesDoctrineCommand.php | 2 +- src/DependencyInjection/DoctrineFixturesExtension.php | 2 +- src/DoctrineFixturesBundle.php | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 101c641..1bc3828 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,6 +1,11 @@ UPGRADE to 4.0 ============== +## Final classes + +Some classes have been marked as `final` because they are not supposed to be +extended. Consider using composition instead of inheritance. + ## Mandatory ManagerRegistry argument It is now mandatory to pass a `ManagerRegistry` instance to the constructor of diff --git a/src/Command/LoadDataFixturesDoctrineCommand.php b/src/Command/LoadDataFixturesDoctrineCommand.php index ee07bdc..de63e8b 100644 --- a/src/Command/LoadDataFixturesDoctrineCommand.php +++ b/src/Command/LoadDataFixturesDoctrineCommand.php @@ -25,7 +25,7 @@ /** * Load data fixtures from bundles. */ -class LoadDataFixturesDoctrineCommand extends DoctrineCommand +final class LoadDataFixturesDoctrineCommand extends DoctrineCommand { /** @param PurgerFactory[] $purgerFactories */ public function __construct( diff --git a/src/DependencyInjection/DoctrineFixturesExtension.php b/src/DependencyInjection/DoctrineFixturesExtension.php index 8d13be4..4431978 100644 --- a/src/DependencyInjection/DoctrineFixturesExtension.php +++ b/src/DependencyInjection/DoctrineFixturesExtension.php @@ -13,7 +13,7 @@ use function dirname; -class DoctrineFixturesExtension extends Extension +final class DoctrineFixturesExtension extends Extension { /** * {@inheritDoc} diff --git a/src/DoctrineFixturesBundle.php b/src/DoctrineFixturesBundle.php index e95464c..c97a73e 100644 --- a/src/DoctrineFixturesBundle.php +++ b/src/DoctrineFixturesBundle.php @@ -11,7 +11,7 @@ use function dirname; -class DoctrineFixturesBundle extends Bundle +final class DoctrineFixturesBundle extends Bundle { public function build(ContainerBuilder $container): void {