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 606da92 commit bb21865
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 0 deletions.
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Upgrade to 2.16

## Deprecated `\Doctrine\ORM\Internal\CommitOrderCalculator` and related classes

With changes made to the commit order computation, the internal classes
`\Doctrine\ORM\Internal\CommitOrderCalculator`, `\Doctrine\ORM\Internal\CommitOrder\Edge`,
`\Doctrine\ORM\Internal\CommitOrder\Vertex` and `\Doctrine\ORM\Internal\CommitOrder\VertexState`
have been deprecated and will be removed in ORM 3.0.

## Deprecated returning post insert IDs from `EntityPersister::executeInserts()`

Persisters implementing `\Doctrine\ORM\Persisters\Entity\EntityPersister` should no longer
Expand Down
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
);

Check warning on line 23 in lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php

View check run for this annotation

Codecov / codecov/patch

lib/Doctrine/ORM/Internal/CommitOrder/VertexState.php#L18-L23

Added lines #L18 - L23 were not covered by tests
}
}
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 bb21865

Please sign in to comment.