Skip to content

Commit 0cd3b3d

Browse files
committed
Remove TABLE and UUID strategies
Signed-off-by: Alexander M. Turek <[email protected]>
1 parent 0ae2a2d commit 0cd3b3d

File tree

14 files changed

+12
-335
lines changed

14 files changed

+12
-335
lines changed

UPGRADE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ Signatures of overridden methods should be changed accordingly
2121

2222
Method `Doctrine\ORM\EntityManagerInterface#copy()` never got its implementation and is removed in 3.0.
2323

24+
## BC BREAK: Removed classes related to UUID and TABLE generator strategies
25+
26+
The following classes have been removed:
27+
- `Doctrine\ORM\Id\TableGenerator`
28+
- `Doctrine\ORM\Id\UuidGenerator`
29+
30+
Using the `UUID` strategy for generating identifiers is not supported anymore.
31+
2432
# Upgrade to 2.10
2533

2634
## BC Break: Removed `TABLE` id generator strategy

lib/Doctrine/ORM/Id/TableGenerator.php

Lines changed: 0 additions & 83 deletions
This file was deleted.

lib/Doctrine/ORM/Id/UuidGenerator.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
use Doctrine\ORM\Id\BigIntegerIdentityGenerator;
1818
use Doctrine\ORM\Id\IdentityGenerator;
1919
use Doctrine\ORM\Id\SequenceGenerator;
20-
use Doctrine\ORM\Id\UuidGenerator;
2120
use Doctrine\ORM\Mapping\Exception\CannotGenerateIds;
2221
use Doctrine\ORM\Mapping\Exception\InvalidCustomGenerator;
23-
use Doctrine\ORM\Mapping\Exception\TableGeneratorNotImplementedYet;
2422
use Doctrine\ORM\Mapping\Exception\UnknownGeneratorType;
2523
use Doctrine\Persistence\Mapping\AbstractClassMetadataFactory;
2624
use Doctrine\Persistence\Mapping\ClassMetadata as ClassMetadataInterface;
@@ -617,16 +615,6 @@ private function completeIdGeneratorMapping(ClassMetadataInfo $class): void
617615
$class->setIdGenerator(new AssignedGenerator());
618616
break;
619617

620-
case ClassMetadata::GENERATOR_TYPE_UUID:
621-
Deprecation::trigger(
622-
'doctrine/orm',
623-
'https://github.com/doctrine/orm/issues/7312',
624-
'Mapping for %s: the "UUID" id generator strategy is deprecated with no replacement',
625-
$class->name
626-
);
627-
$class->setIdGenerator(new UuidGenerator());
628-
break;
629-
630618
case ClassMetadata::GENERATOR_TYPE_CUSTOM:
631619
$definition = $class->customGeneratorDefinition;
632620
if ($definition === null) {

lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Doctrine\Deprecations\Deprecation;
1515
use Doctrine\Instantiator\Instantiator;
1616
use Doctrine\Instantiator\InstantiatorInterface;
17-
use Doctrine\ORM\Cache\Exception\CacheException;
1817
use Doctrine\ORM\Cache\Exception\NonCacheableEntityAssociation;
1918
use Doctrine\ORM\Id\AbstractIdGenerator;
2019
use Doctrine\Persistence\Mapping\ClassMetadata;
@@ -111,15 +110,6 @@ class ClassMetadataInfo implements ClassMetadata
111110
*/
112111
public const GENERATOR_TYPE_SEQUENCE = 2;
113112

114-
/**
115-
* TABLE means a separate table is used for id generation.
116-
* Offers full portability (in that it results in an exception being thrown
117-
* no matter the platform).
118-
*
119-
* @deprecated no replacement planned
120-
*/
121-
public const GENERATOR_TYPE_TABLE = 3;
122-
123113
/**
124114
* IDENTITY means an identity column is used for id generation. The database
125115
* will fill in the id column on insertion. Platforms that do not support
@@ -134,14 +124,6 @@ class ClassMetadataInfo implements ClassMetadata
134124
*/
135125
public const GENERATOR_TYPE_NONE = 5;
136126

137-
/**
138-
* UUID means that a UUID/GUID expression is used for id generation. Full
139-
* portability is currently not guaranteed.
140-
*
141-
* @deprecated use an application-side generator instead
142-
*/
143-
public const GENERATOR_TYPE_UUID = 6;
144-
145127
/**
146128
* CUSTOM means that customer will use own ID generator that supposedly work
147129
*/
@@ -2231,18 +2213,6 @@ public function isIdGeneratorSequence()
22312213
return $this->generatorType === self::GENERATOR_TYPE_SEQUENCE;
22322214
}
22332215

2234-
/**
2235-
* Checks whether the class uses a table for id generation.
2236-
*
2237-
* @deprecated
2238-
*
2239-
* @return false
2240-
*/
2241-
public function isIdGeneratorTable()
2242-
{
2243-
return false;
2244-
}
2245-
22462216
/**
22472217
* Checks whether the class has a natural identifier/pk (which means it does
22482218
* not use any Id generator.
@@ -2254,16 +2224,6 @@ public function isIdentifierNatural()
22542224
return $this->generatorType === self::GENERATOR_TYPE_NONE;
22552225
}
22562226

2257-
/**
2258-
* Checks whether the class use a UUID for id generation.
2259-
*
2260-
* @return bool
2261-
*/
2262-
public function isIdentifierUuid()
2263-
{
2264-
return $this->generatorType === self::GENERATOR_TYPE_UUID;
2265-
}
2266-
22672227
/**
22682228
* Gets the type of a field.
22692229
*

lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
namespace Doctrine\ORM\Mapping\Driver;
66

77
use Doctrine\Common\Annotations\AnnotationReader;
8-
use Doctrine\Common\Annotations\Reader;
9-
use Doctrine\DBAL\Types\Type;
10-
use Doctrine\ORM\Annotation;
11-
use Doctrine\ORM\Cache\Exception\CacheException;
128
use Doctrine\ORM\Events;
13-
use Doctrine\ORM\Id\TableGenerator;
149
use Doctrine\ORM\Mapping;
1510
use Doctrine\ORM\Mapping\Builder\EntityListenerBuilder;
1611
use Doctrine\ORM\Mapping\MappingException;

lib/Doctrine/ORM/Tools/EntityGenerator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ class EntityGenerator
221221
ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE => 'SEQUENCE',
222222
ClassMetadataInfo::GENERATOR_TYPE_IDENTITY => 'IDENTITY',
223223
ClassMetadataInfo::GENERATOR_TYPE_NONE => 'NONE',
224-
ClassMetadataInfo::GENERATOR_TYPE_UUID => 'UUID',
225224
ClassMetadataInfo::GENERATOR_TYPE_CUSTOM => 'CUSTOM',
226225
];
227226

lib/Doctrine/ORM/Tools/Export/Driver/AbstractExporter.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ protected function _getIdGeneratorTypeString($type)
253253
case ClassMetadataInfo::GENERATOR_TYPE_IDENTITY:
254254
return 'IDENTITY';
255255

256-
case ClassMetadataInfo::GENERATOR_TYPE_UUID:
257-
return 'UUID';
258-
259256
case ClassMetadataInfo::GENERATOR_TYPE_CUSTOM:
260257
return 'CUSTOM';
261258
}

phpstan-baseline.neon

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,6 @@ parameters:
215215
count: 1
216216
path: lib/Doctrine/ORM/Event/PreFlushEventArgs.php
217217

218-
-
219-
message: "#^Call to an undefined method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getTableHiLoCurrentValSql\\(\\)\\.$#"
220-
count: 1
221-
path: lib/Doctrine/ORM/Id/TableGenerator.php
222-
223-
-
224-
message: "#^Call to an undefined method Doctrine\\\\DBAL\\\\Platforms\\\\AbstractPlatform\\:\\:getTableHiLoUpdateNextValSql\\(\\)\\.$#"
225-
count: 1
226-
path: lib/Doctrine/ORM/Id/TableGenerator.php
227-
228218
-
229219
message: "#^Parameter \\#2 \\$discrMap of static method Doctrine\\\\ORM\\\\Internal\\\\Hydration\\\\HydrationException\\:\\:invalidDiscriminatorValue\\(\\) expects array\\<string, string\\>, array\\<int, int\\|string\\> given\\.$#"
230220
count: 1
@@ -2092,7 +2082,7 @@ parameters:
20922082
path: lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
20932083

20942084
-
2095-
message: "#^Parameter \\#1 \\$type of method Doctrine\\\\ORM\\\\Tools\\\\Export\\\\Driver\\\\AbstractExporter\\:\\:_getIdGeneratorTypeString\\(\\) expects 1\\|2\\|3\\|4\\|5\\|6\\|7, int given\\.$#"
2085+
message: "#^Parameter \\#1 \\$type of method Doctrine\\\\ORM\\\\Tools\\\\Export\\\\Driver\\\\AbstractExporter\\:\\:_getIdGeneratorTypeString\\(\\) expects 1\\|2\\|4\\|5\\|7, int given\\.$#"
20962086
count: 1
20972087
path: lib/Doctrine/ORM/Tools/Export/Driver/PhpExporter.php
20982088

@@ -2102,7 +2092,7 @@ parameters:
21022092
path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
21032093

21042094
-
2105-
message: "#^Parameter \\#1 \\$type of method Doctrine\\\\ORM\\\\Tools\\\\Export\\\\Driver\\\\AbstractExporter\\:\\:_getIdGeneratorTypeString\\(\\) expects 1\\|2\\|3\\|4\\|5\\|6\\|7, int given\\.$#"
2095+
message: "#^Parameter \\#1 \\$type of method Doctrine\\\\ORM\\\\Tools\\\\Export\\\\Driver\\\\AbstractExporter\\:\\:_getIdGeneratorTypeString\\(\\) expects 1\\|2\\|4\\|5\\|7, int given\\.$#"
21062096
count: 2
21072097
path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
21082098

@@ -2112,7 +2102,7 @@ parameters:
21122102
path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php
21132103

21142104
-
2115-
message: "#^Parameter \\#1 \\$type of method Doctrine\\\\ORM\\\\Tools\\\\Export\\\\Driver\\\\AbstractExporter\\:\\:_getIdGeneratorTypeString\\(\\) expects 1\\|2\\|3\\|4\\|5\\|6\\|7, int given\\.$#"
2105+
message: "#^Parameter \\#1 \\$type of method Doctrine\\\\ORM\\\\Tools\\\\Export\\\\Driver\\\\AbstractExporter\\:\\:_getIdGeneratorTypeString\\(\\) expects 1\\|2\\|4\\|5\\|7, int given\\.$#"
21162106
count: 1
21172107
path: lib/Doctrine/ORM/Tools/Export/Driver/YamlExporter.php
21182108

phpstan.neon

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ includes:
44

55
parameters:
66
ignoreErrors:
7-
# deprecations from doctrine/dbal:3.x
8-
- '/^Call to an undefined method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getGuidExpression\(\).$/'
9-
107
# Fallback logic for DBAL 2
118
-
129
message: '/HelperSet constructor expects/'

0 commit comments

Comments
 (0)