Skip to content

Commit

Permalink
Remove ClassMetadataInfo
Browse files Browse the repository at this point in the history
It has been deprecated for a long, long time.
  • Loading branch information
greg0ire committed May 1, 2022
1 parent 467bc6f commit ef84d64
Show file tree
Hide file tree
Showing 12 changed files with 3,405 additions and 3,483 deletions.
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Upgrade to 3.0

## BC BREAK: Remove `Doctrine\ORM\Mapping\ClassMetadataInfo`

Use `Doctrine\ORM\Mapping\ClassMetadata` instead.

## BC BREAK: Remove `Doctrine\ORM\Tools\DisconnectedClassMetadataFactory`

No replacement is provided.
Expand Down
24 changes: 3 additions & 21 deletions lib/Doctrine/ORM/Mapping/Builder/ClassMetadataBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@

namespace Doctrine\ORM\Mapping\Builder;

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

use function get_class;

/**
* Builder Object for ClassMetadata
Expand All @@ -17,29 +13,15 @@
*/
class ClassMetadataBuilder
{
/** @var ClassMetadataInfo */
/** @var ClassMetadata */
private $cm;

public function __construct(ClassMetadataInfo $cm)
public function __construct(ClassMetadata $cm)
{
if (! $cm instanceof ClassMetadata) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/pull/249',
'Passing an instance of %s to %s is deprecated, please pass a ClassMetadata instance instead.',
get_class($cm),
__METHOD__,
ClassMetadata::class
);
}

$this->cm = $cm;
}

/**
* @return ClassMetadataInfo
*/
public function getClassMetadata()
public function getClassMetadata(): ClassMetadata
{
return $this->cm;
}
Expand Down
Loading

0 comments on commit ef84d64

Please sign in to comment.