Skip to content

Commit

Permalink
Use ClassMetadata over ClassMetadataInfo in tests
Browse files Browse the repository at this point in the history
ClassMetadataInfo is deprecated in favor of ClassMetadata.
  • Loading branch information
greg0ire committed Apr 28, 2022
1 parent 38d1124 commit 0078a67
Show file tree
Hide file tree
Showing 58 changed files with 190 additions and 198 deletions.
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/CMS/CmsAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\ORM\Events;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\ColumnResult;
use Doctrine\ORM\Mapping\Entity;
Expand Down Expand Up @@ -157,7 +157,7 @@ public function setUser(CmsUser $user): void
}
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->setPrimaryTable(
['name' => 'company_person']
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/CMS/CmsUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\ColumnResult;
use Doctrine\ORM\Mapping\Entity;
Expand Down Expand Up @@ -336,7 +336,7 @@ public function setEmail(?CmsEmail $email = null): void
}
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->setPrimaryTable(
['name' => 'cms_users']
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/Cache/City.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\Cache;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
Expand Down Expand Up @@ -136,7 +136,7 @@ public function getAttractions(): Collection
return $this->attractions;
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
include __DIR__ . '/../../ORM/Mapping/php/Doctrine.Tests.Models.Cache.City.php';
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Doctrine/Tests/Models/Company/CompanyContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Doctrine\ORM\Events;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\DiscriminatorColumn;
use Doctrine\ORM\Mapping\DiscriminatorMap;
Expand Down Expand Up @@ -170,7 +169,7 @@ public function removeEngineer(CompanyEmployee $engineer): void

abstract public function calculatePrice(): int;

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->setInheritanceType(ClassMetadata::INHERITANCE_TYPE_JOINED);
$metadata->setTableName('company_contracts');
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/Company/CompanyFixContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\Company;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;

Expand Down Expand Up @@ -36,7 +36,7 @@ public function setFixPrice($fixPrice): void
$this->fixPrice = $fixPrice;
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\EntityResult;
Expand Down Expand Up @@ -140,7 +140,7 @@ public function removeManager(CompanyManager $manager): void
$this->managers->removeElement($manager);
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\ORM\Events;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\EntityListeners;
Expand Down Expand Up @@ -42,7 +42,7 @@ public function setMaxPrice(int $maxPrice): void
$this->maxPrice = $maxPrice;
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/Company/CompanyPerson.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\DiscriminatorColumn;
use Doctrine\ORM\Mapping\DiscriminatorMap;
Expand Down Expand Up @@ -153,7 +153,7 @@ public function setSpouse(CompanyPerson $spouse): void
}
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->setPrimaryTable(
['name' => 'company_person']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\DDC1476;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
Expand Down Expand Up @@ -48,7 +48,7 @@ public function setName(string $name): void
$this->name = $name;
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand All @@ -60,6 +60,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void
['fieldName' => 'name']
);

$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
}
}
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/DDC3579/DDC3579User.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\DDC3579;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
Expand Down Expand Up @@ -105,6 +105,6 @@ public static function loadMetadata($metadata): void
]
);

$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO);
}
}
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/DDC869/DDC869ChequePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\DDC869;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;

Expand All @@ -22,7 +22,7 @@ class DDC869ChequePayment extends DDC869Payment
#[ORM\Column(type: 'string')]
protected $serialNumber;

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\DDC869;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;

Expand All @@ -22,7 +22,7 @@ class DDC869CreditCardPayment extends DDC869Payment
#[ORM\Column(type: 'string')]
protected $creditCardNumber;

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand Down
6 changes: 3 additions & 3 deletions tests/Doctrine/Tests/Models/DDC869/DDC869Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\DDC869;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
Expand Down Expand Up @@ -33,7 +33,7 @@ class DDC869Payment
#[ORM\Column(type: 'float')]
protected $value;

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand All @@ -51,6 +51,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void
);
$metadata->isMappedSuperclass = true;
$metadata->setCustomRepositoryClass(DDC869PaymentRepository::class);
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO);
}
}
6 changes: 3 additions & 3 deletions tests/Doctrine/Tests/Models/DDC889/DDC889Class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\Tests\Models\DDC889;

use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
Expand All @@ -19,7 +19,7 @@ class DDC889Class extends DDC889SuperClass
*/
protected $id;

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand All @@ -30,6 +30,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void
]
);

$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO);
}
}
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/DDC889/DDC889Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\DDC889;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Entity;

/**
Expand All @@ -14,7 +14,7 @@
#[ORM\Entity]
class DDC889Entity extends DDC889SuperClass
{
public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
6 changes: 3 additions & 3 deletions tests/Doctrine/Tests/Models/DDC889/DDC889SuperClass.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Doctrine\Tests\Models\DDC889;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\MappedSuperclass;

Expand All @@ -22,13 +22,13 @@ class DDC889SuperClass
#[ORM\Column]
protected $name;

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
['fieldName' => 'name']
);

$metadata->isMappedSuperclass = true;
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_NONE);
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_NONE);
}
}
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/DDC964/DDC964Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\ORM\Mapping\AssociationOverride;
use Doctrine\ORM\Mapping\AssociationOverrides;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\JoinTable;
Expand All @@ -32,7 +32,7 @@
#[AssociationOverrides([new AssociationOverride(name: 'groups', joinTable: new JoinTable(name: 'ddc964_users_admingroups'), joinColumns: [new JoinColumn(name: 'adminuser_id')], inverseJoinColumns: [new JoinColumn(name: 'admingroup_id')]), new AssociationOverride(name: 'address', joinColumns: [new JoinColumn(name: 'adminaddress_id', referencedColumnName: 'id')])])]
class DDC964Admin extends DDC964User
{
public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->setAssociationOverride(
'address',
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/DDC964/DDC964Guest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\ORM\Mapping\AttributeOverride;
use Doctrine\ORM\Mapping\AttributeOverrides;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;

Expand Down Expand Up @@ -34,7 +34,7 @@
#[AttributeOverrides([new AttributeOverride(name: 'id', column: new Column(name: 'guest_id', type: 'integer', length: 140)), new AttributeOverride(name: 'name', column: new Column(name: 'guest_name', nullable: false, unique: true, length: 240))])]
class DDC964Guest extends DDC964User
{
public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->setAttributeOverride('id', [
'columnName' => 'guest_id',
Expand Down
6 changes: 3 additions & 3 deletions tests/Doctrine/Tests/Models/DDC964/DDC964User.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
Expand Down Expand Up @@ -107,7 +107,7 @@ public function setAddress(DDC964Address $address): void
$this->address = $address;
}

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->isMappedSuperclass = true;

Expand Down Expand Up @@ -164,6 +164,6 @@ public static function loadMetadata(ClassMetadataInfo $metadata): void
]
);

$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
$metadata->setIdGeneratorType(ClassMetadata::GENERATOR_TYPE_AUTO);
}
}
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/Models/Enums/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\Tests\Models\Enums;

use Doctrine\ORM\Mapping\ClassMetadataInfo;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
Expand All @@ -28,7 +28,7 @@ class Card
#[Column(type: 'string', enumType: Suit::class)]
public $suit;

public static function loadMetadata(ClassMetadataInfo $metadata): void
public static function loadMetadata(ClassMetadata $metadata): void
{
$metadata->mapField(
[
Expand Down
Loading

0 comments on commit 0078a67

Please sign in to comment.