Skip to content

Commit

Permalink
Deprecate classes related to old commit order computation
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Jul 4, 2023
1 parent 7ef4afc commit 83e1732
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Doctrine/ORM/Internal/CommitOrder/Edge.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Doctrine\ORM\Internal\CommitOrder;

use Doctrine\Deprecations\Deprecation;

/** @internal */
final class Edge
{
Expand All @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions lib/Doctrine/ORM/Internal/CommitOrder/Vertex.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Doctrine\ORM\Internal\CommitOrder;

use Doctrine\Deprecations\Deprecation;
use Doctrine\ORM\Mapping\ClassMetadata;

/** @internal */
Expand Down Expand Up @@ -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;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Doctrine\ORM\Internal\CommitOrder;

use Doctrine\Deprecations\Deprecation;

/** @internal */
final class VertexState
{
Expand All @@ -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
);
}
}
11 changes: 11 additions & 0 deletions lib/Doctrine/ORM/Internal/CommitOrderCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 83e1732

Please sign in to comment.