From da26e0b5fdb304caec5a0f1e9bb2476a57d1654b Mon Sep 17 00:00:00 2001 From: Erison Silva Date: Fri, 8 Jul 2022 08:50:02 +0200 Subject: [PATCH] Feature/1415/Remove notification from cleanup snapshoot Issue #1415 --- src/Consumer/CleanupSnapshotConsumer.php | 15 +++++++++++++++ src/Consumer/CleanupSnapshotsConsumer.php | 13 +++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/Consumer/CleanupSnapshotConsumer.php b/src/Consumer/CleanupSnapshotConsumer.php index c4356cff1..3a343983a 100644 --- a/src/Consumer/CleanupSnapshotConsumer.php +++ b/src/Consumer/CleanupSnapshotConsumer.php @@ -13,15 +13,21 @@ namespace Sonata\PageBundle\Consumer; +use Sonata\NotificationBundle\Backend\BackendInterface; use Sonata\NotificationBundle\Consumer\ConsumerEvent; use Sonata\NotificationBundle\Consumer\ConsumerInterface; use Sonata\PageBundle\Model\PageManagerInterface; use Sonata\PageBundle\Model\SnapshotManagerInterface; +use Sonata\PageBundle\Service\Contract\CreateSnapshotByPageInterface; /** * Consumer class to cleanup snapshots by a given page. * + * NEXT_MAJOR: Remove this class + * * @final since sonata-project/page-bundle 3.26 + * + * @deprecated since 3.27, and it will be removed in 4.0. */ class CleanupSnapshotConsumer implements ConsumerInterface { @@ -41,6 +47,15 @@ class CleanupSnapshotConsumer implements ConsumerInterface */ public function __construct(SnapshotManagerInterface $snapshotManager, PageManagerInterface $pageManager) { + @trigger_error( + sprintf( + 'This %s is deprecated since sonata-project/page-bundle 3.27.0'. + ' and will be removed in 4.0', + self::class + ), + \E_USER_DEPRECATED + ); + $this->snapshotManager = $snapshotManager; $this->pageManager = $pageManager; } diff --git a/src/Consumer/CleanupSnapshotsConsumer.php b/src/Consumer/CleanupSnapshotsConsumer.php index fec4cfa4e..449f3f2e6 100644 --- a/src/Consumer/CleanupSnapshotsConsumer.php +++ b/src/Consumer/CleanupSnapshotsConsumer.php @@ -21,7 +21,11 @@ /** * Consumer class to cleanup snapshots. * + * NEXT_MAJOR: Remove this class + * * @final since sonata-project/page-bundle 3.26 + * + * @deprecated since 3.27, and it will be removed in 4.0. */ class CleanupSnapshotsConsumer implements ConsumerInterface { @@ -47,6 +51,15 @@ class CleanupSnapshotsConsumer implements ConsumerInterface */ public function __construct(BackendInterface $asyncBackend, BackendInterface $runtimeBackend, PageManagerInterface $pageManager) { + @trigger_error( + sprintf( + 'This %s is deprecated since sonata-project/page-bundle 3.27.0'. + ' and will be removed in 4.0', + self::class + ), + \E_USER_DEPRECATED + ); + $this->asyncBackend = $asyncBackend; $this->runtimeBackend = $runtimeBackend; $this->pageManager = $pageManager;