From a7bdc9dd71af32352e99a40cef11986717126b48 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Tue, 4 Jul 2023 14:22:10 +0200 Subject: [PATCH] Deprecate classes related to old commit order computation --- lib/Doctrine/ORM/Internal/CommitOrder/Edge.php | 9 +++++++++ lib/Doctrine/ORM/Internal/CommitOrder/Vertex.php | 8 ++++++++ lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php | 8 ++++++++ lib/Doctrine/ORM/Internal/CommitOrderCalculator.php | 11 +++++++++++ 4 files changed, 36 insertions(+) diff --git a/lib/Doctrine/ORM/Internal/CommitOrder/Edge.php b/lib/Doctrine/ORM/Internal/CommitOrder/Edge.php index f1457755ee1..dc840c93843 100644 --- a/lib/Doctrine/ORM/Internal/CommitOrder/Edge.php +++ b/lib/Doctrine/ORM/Internal/CommitOrder/Edge.php @@ -4,6 +4,8 @@ namespace Doctrine\ORM\Internal\CommitOrder; +use Doctrine\Deprecations\Deprecation; + /** @internal */ final class Edge { @@ -27,6 +29,13 @@ final class Edge public function __construct(string $from, string $to, int $weight) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/orm', + 'https://github.com/doctrine/orm/pull/10547', + 'The %s class is deprecated and will be removed in ORM 3.0', + self::class + ); + $this->from = $from; $this->to = $to; $this->weight = $weight; diff --git a/lib/Doctrine/ORM/Internal/CommitOrder/Vertex.php b/lib/Doctrine/ORM/Internal/CommitOrder/Vertex.php index c4747e032d1..969a75b851a 100644 --- a/lib/Doctrine/ORM/Internal/CommitOrder/Vertex.php +++ b/lib/Doctrine/ORM/Internal/CommitOrder/Vertex.php @@ -4,6 +4,7 @@ namespace Doctrine\ORM\Internal\CommitOrder; +use Doctrine\Deprecations\Deprecation; use Doctrine\ORM\Mapping\ClassMetadata; /** @internal */ @@ -32,6 +33,13 @@ final class Vertex public function __construct(string $hash, ClassMetadata $value) { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/orm', + 'https://github.com/doctrine/orm/pull/10547', + 'The %s class is deprecated and will be removed in ORM 3.0', + self::class + ); + $this->hash = $hash; $this->value = $value; } diff --git a/lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php b/lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php index 395db58d554..9ace165d20d 100644 --- a/lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php +++ b/lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php @@ -4,6 +4,8 @@ namespace Doctrine\ORM\Internal\CommitOrder; +use Doctrine\Deprecations\Deprecation; + /** @internal */ final class VertexState { @@ -13,5 +15,11 @@ final class VertexState private function __construct() { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/orm', + 'https://github.com/doctrine/orm/pull/10547', + 'The %s class is deprecated and will be removed in ORM 3.0', + self::class + ); } } diff --git a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php index 22ee1ab13bd..d45e65c40b5 100644 --- a/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php +++ b/lib/Doctrine/ORM/Internal/CommitOrderCalculator.php @@ -4,6 +4,7 @@ namespace Doctrine\ORM\Internal; +use Doctrine\Deprecations\Deprecation; use Doctrine\ORM\Internal\CommitOrder\Edge; use Doctrine\ORM\Internal\CommitOrder\Vertex; use Doctrine\ORM\Internal\CommitOrder\VertexState; @@ -45,6 +46,16 @@ class CommitOrderCalculator */ private $sortedNodeList = []; + public function __construct() + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/orm', + 'https://github.com/doctrine/orm/pull/10547', + 'The %s class is deprecated and will be removed in ORM 3.0', + self::class + ); + } + /** * Checks for node (vertex) existence in graph. *