[DoctineBridge] Remove UuidV*Generator
This commit is contained in:
parent
bf99d8c9b2
commit
3c296bd2f5
@ -6,6 +6,11 @@ Asset
|
||||
|
||||
* Deprecated `RemoteJsonManifestVersionStrategy`, use `JsonManifestVersionStrategy` instead
|
||||
|
||||
DoctrineBridge
|
||||
--------------
|
||||
|
||||
* Remove `UuidV*Generator` classes
|
||||
|
||||
DomCrawler
|
||||
----------
|
||||
|
||||
|
@ -4,7 +4,8 @@ CHANGELOG
|
||||
5.3
|
||||
---
|
||||
|
||||
* deprecated `DoctrineTestHelper` and `TestRepositoryFactory`
|
||||
* Deprecate `DoctrineTestHelper` and `TestRepositoryFactory`
|
||||
* [BC BREAK] Remove `UuidV*Generator` classes
|
||||
|
||||
5.2.0
|
||||
-----
|
||||
|
@ -15,9 +15,6 @@ use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\Id\AbstractIdGenerator;
|
||||
use Symfony\Component\Uid\Ulid;
|
||||
|
||||
/**
|
||||
* @experimental in 5.2
|
||||
*/
|
||||
final class UlidGenerator extends AbstractIdGenerator
|
||||
{
|
||||
public function generate(EntityManager $em, $entity): Ulid
|
||||
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\Doctrine\IdGenerator;
|
||||
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\Id\AbstractIdGenerator;
|
||||
use Symfony\Component\Uid\UuidV1;
|
||||
|
||||
/**
|
||||
* @experimental in 5.2
|
||||
*/
|
||||
final class UuidV1Generator extends AbstractIdGenerator
|
||||
{
|
||||
public function generate(EntityManager $em, $entity): UuidV1
|
||||
{
|
||||
return new UuidV1();
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\Doctrine\IdGenerator;
|
||||
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\Id\AbstractIdGenerator;
|
||||
use Symfony\Component\Uid\UuidV4;
|
||||
|
||||
/**
|
||||
* @experimental in 5.2
|
||||
*/
|
||||
final class UuidV4Generator extends AbstractIdGenerator
|
||||
{
|
||||
public function generate(EntityManager $em, $entity): UuidV4
|
||||
{
|
||||
return new UuidV4();
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\Doctrine\IdGenerator;
|
||||
|
||||
use Doctrine\ORM\EntityManager;
|
||||
use Doctrine\ORM\Id\AbstractIdGenerator;
|
||||
use Symfony\Component\Uid\UuidV6;
|
||||
|
||||
/**
|
||||
* @experimental in 5.2
|
||||
*/
|
||||
final class UuidV6Generator extends AbstractIdGenerator
|
||||
{
|
||||
public function generate(EntityManager $em, $entity): UuidV6
|
||||
{
|
||||
return new UuidV6();
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\Doctrine\Tests\IdGenerator;
|
||||
|
||||
use Doctrine\ORM\Mapping\Entity;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bridge\Doctrine\IdGenerator\UuidV1Generator;
|
||||
use Symfony\Component\Uid\AbstractUid;
|
||||
use Symfony\Component\Uid\UuidV1;
|
||||
|
||||
class UuidV1GeneratorTest extends TestCase
|
||||
{
|
||||
public function testUuidv1CanBeGenerated()
|
||||
{
|
||||
$em = new EntityManager();
|
||||
$generator = new UuidV1Generator();
|
||||
|
||||
$uuid = $generator->generate($em, new Entity());
|
||||
|
||||
$this->assertInstanceOf(AbstractUid::class, $uuid);
|
||||
$this->assertInstanceOf(UuidV1::class, $uuid);
|
||||
$this->assertTrue(UuidV1::isValid($uuid));
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\Doctrine\Tests\IdGenerator;
|
||||
|
||||
use Doctrine\ORM\Mapping\Entity;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bridge\Doctrine\IdGenerator\UuidV4Generator;
|
||||
use Symfony\Component\Uid\AbstractUid;
|
||||
use Symfony\Component\Uid\UuidV4;
|
||||
|
||||
class UuidV4GeneratorTest extends TestCase
|
||||
{
|
||||
public function testUuidv4CanBeGenerated()
|
||||
{
|
||||
$em = new EntityManager();
|
||||
$generator = new UuidV4Generator();
|
||||
|
||||
$uuid = $generator->generate($em, new Entity());
|
||||
|
||||
$this->assertInstanceOf(AbstractUid::class, $uuid);
|
||||
$this->assertInstanceOf(UuidV4::class, $uuid);
|
||||
$this->assertTrue(UuidV4::isValid($uuid));
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Bridge\Doctrine\Tests\IdGenerator;
|
||||
|
||||
use Doctrine\ORM\Mapping\Entity;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Bridge\Doctrine\IdGenerator\UuidV6Generator;
|
||||
use Symfony\Component\Uid\AbstractUid;
|
||||
use Symfony\Component\Uid\UuidV6;
|
||||
|
||||
class UuidV6GeneratorTest extends TestCase
|
||||
{
|
||||
public function testUuidv6CanBeGenerated()
|
||||
{
|
||||
$em = new EntityManager();
|
||||
$generator = new UuidV6Generator();
|
||||
|
||||
$uuid = $generator->generate($em, new Entity());
|
||||
|
||||
$this->assertInstanceOf(AbstractUid::class, $uuid);
|
||||
$this->assertInstanceOf(UuidV6::class, $uuid);
|
||||
$this->assertTrue(UuidV6::isValid($uuid));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user