Skip to content

Commit

Permalink
Revert unnecessary changes from #10473
Browse files Browse the repository at this point in the history
  • Loading branch information
mpdude committed Mar 1, 2023
1 parent dae2ea9 commit ee30dd4
Show file tree
Hide file tree
Showing 36 changed files with 12 additions and 196 deletions.
6 changes: 0 additions & 6 deletions tests/Doctrine/Tests/Models/Cache/Attraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping\Cache;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\DiscriminatorMap;
use Doctrine\ORM\Mapping\Entity;
Expand All @@ -30,7 +29,6 @@
* 3 = "Bar"
* })
*/
#[Entity]
abstract class Attraction
{
/**
Expand Down Expand Up @@ -111,8 +109,4 @@ public function addInfo(AttractionInfo $info): void
$this->infos->add($info);
}
}

public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
6 changes: 0 additions & 6 deletions tests/Doctrine/Tests/Models/Cache/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping\Cache;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
Expand All @@ -22,7 +21,6 @@
* @Table("cache_state")
* @Cache("NONSTRICT_READ_WRITE")
*/
#[Entity]
class State
{
/**
Expand Down Expand Up @@ -107,8 +105,4 @@ public function addCity(City $city): void
{
$this->cities[] = $city;
}

public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
6 changes: 0 additions & 6 deletions tests/Doctrine/Tests/Models/Cache/Travel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping\Cache;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
Expand All @@ -24,7 +23,6 @@
* @Entity
* @Table("cache_travel")
*/
#[Entity]
class Travel
{
/**
Expand Down Expand Up @@ -106,8 +104,4 @@ public function getCreatedAt(): DateTime
{
return $this->createdAt;
}

public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
5 changes: 0 additions & 5 deletions tests/Doctrine/Tests/Models/DDC3579/DDC3579Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
Expand Down Expand Up @@ -68,8 +67,4 @@ public function getAdmins(): Collection
{
return $this->admins;
}

public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
5 changes: 0 additions & 5 deletions tests/Doctrine/Tests/Models/DDC5934/DDC5934Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\ClassMetadata;

/** @ORM\Entity() */
#[ORM\Entity]
Expand All @@ -24,8 +23,4 @@ public function __construct()
{
$this->contracts = new ArrayCollection();
}

public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
6 changes: 0 additions & 6 deletions tests/Doctrine/Tests/Models/DDC964/DDC964Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@

namespace Doctrine\Tests\Models\DDC964;

use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;

/** @Entity */
#[Entity]
class DDC964Address
{
/**
Expand Down Expand Up @@ -102,8 +100,4 @@ public function setStreet(string $street): void
{
$this->street = $street;
}

public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
6 changes: 0 additions & 6 deletions tests/Doctrine/Tests/Models/DDC964/DDC964Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
namespace Doctrine\Tests\Models\DDC964;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\ManyToMany;

/** @Entity */
#[Entity]
class DDC964Group
{
/**
Expand Down Expand Up @@ -62,8 +60,4 @@ public function getUsers(): ArrayCollection
{
return $this->users;
}

public static function loadMetadata(ClassMetadata $metadata): void
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ class MappedSuperclassBase
private $transient;
}

/** @Entity */
class MappedSuperclassRelated1
{
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use Doctrine\ORM\Mapping\Driver\YamlDriver;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
use Doctrine\ORM\Tools\EntityGenerator;
use Doctrine\ORM\Tools\Export\ClassMetadataExporter;
Expand All @@ -26,9 +25,8 @@
use Doctrine\Tests\TestUtil;
use Symfony\Component\Yaml\Parser;

use function array_filter;
use function array_values;
use function count;
use function current;
use function file_get_contents;
use function glob;
use function is_array;
Expand Down Expand Up @@ -108,9 +106,7 @@ public function testExportDirectoryAndFilesAreCreated(): void
$metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/' . $type);
$em = $this->createEntityManager($metadataDriver);
$cmf = $this->createClassMetadataFactory($em, $type);
$metadata = array_values(array_filter($cmf->getAllMetadata(), static function (ClassMetadata $class): bool {
return $class->name === User::class;
}));
$metadata = $cmf->getAllMetadata();

$metadata[0]->name = ExportedUser::class;

Expand Down Expand Up @@ -146,15 +142,15 @@ public function testExportedMetadataCanBeReadBackIn(): ClassMetadata
$metadataDriver = $this->createMetadataDriver($type, __DIR__ . '/export/' . $type);
$em = $this->createEntityManager($metadataDriver);
$cmf = $this->createClassMetadataFactory($em, $type);
$metadatas = $cmf->getAllMetadata();
$metadata = $cmf->getAllMetadata();

foreach ($metadatas as $metadata) {
if ($metadata->name === ExportedUser::class) {
return $metadata;
}
}
self::assertCount(1, $metadata);

$class = current($metadata);

self::assertEquals(ExportedUser::class, $class->name);

$this->fail('Expected metadata not found');
return $class;
}

/** @depends testExportedMetadataCanBeReadBackIn */
Expand Down Expand Up @@ -392,11 +388,12 @@ protected function deleteDirectory(string $path): void
}
}

/** @Entity */
class Address
{
}
class Phonenumber
{
}
/** @Entity */
class Group
{
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit ee30dd4

Please sign in to comment.