Skip to content

Commit e3ff6cc

Browse files
authored
Remove deprecated types INTID, INTEGER, BOOLEAN (#2894)
1 parent b38441b commit e3ff6cc

File tree

5 files changed

+2
-46
lines changed

5 files changed

+2
-46
lines changed

src/Mapping/ClassMetadata.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2580,21 +2580,6 @@ public function mapField(array $mapping): array
25802580
$this->checkDuplicateMapping($mapping);
25812581
$this->typeRequirementsAreMet($mapping);
25822582

2583-
$deprecatedTypes = [
2584-
Type::BOOLEAN => Type::BOOL,
2585-
Type::INTEGER => Type::INT,
2586-
Type::INTID => Type::INT,
2587-
];
2588-
if (isset($deprecatedTypes[$mapping['type']])) {
2589-
trigger_deprecation(
2590-
'doctrine/mongodb-odm',
2591-
'2.1',
2592-
'The "%s" mapping type is deprecated. Use "%s" instead.',
2593-
$mapping['type'],
2594-
$deprecatedTypes[$mapping['type']],
2595-
);
2596-
}
2597-
25982583
$this->fieldMappings[$mapping['fieldName']] = $mapping;
25992584
if (isset($mapping['association'])) {
26002585
$this->associationMappings[$mapping['fieldName']] = $mapping;

src/Types/IntIdType.php

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

src/Types/Type.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,15 @@ abstract class Type
4949
public const VECTOR_INT8 = 'vector_int8';
5050
public const VECTOR_PACKED_BIT = 'vector_packed_bit';
5151

52-
/** @deprecated const was deprecated in doctrine/mongodb-odm 2.1 and will be removed in 3.0. Use Type::INT instead */
53-
public const INTID = 'int_id';
54-
55-
/** @deprecated const was deprecated in doctrine/mongodb-odm 2.1 and will be removed in 3.0. Use Type::INT instead */
56-
public const INTEGER = 'integer';
57-
58-
/** @deprecated const was deprecated in doctrine/mongodb-odm 2.1 and will be removed in 3.0. Use Type::BOOL instead */
59-
public const BOOLEAN = 'boolean';
60-
6152
/** @var Type[] Map of already instantiated type objects. One instance per type (flyweight). */
6253
private static array $typeObjects = [];
6354

6455
/** @var array<string, class-string> The map of supported doctrine mapping types. */
6556
private static array $typesMap = [
6657
self::ID => Types\IdType::class,
67-
self::INTID => Types\IntIdType::class,
6858
self::CUSTOMID => Types\CustomIdType::class,
6959
self::BOOL => Types\BooleanType::class,
70-
self::BOOLEAN => Types\BooleanType::class,
7160
self::INT => Types\IntType::class,
72-
self::INTEGER => Types\IntType::class,
7361
self::INT64 => Types\Int64Type::class,
7462
self::FLOAT => Types\FloatType::class,
7563
self::STRING => Types\StringType::class,

src/Utility/EncryptedFieldsMapGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private function createEncryptedFieldsForClass(
121121
'bsonType' => match ($mapping['type']) {
122122
ClassMetadata::ONE, Type::HASH => 'object',
123123
ClassMetadata::MANY, Type::COLLECTION => 'array',
124-
Type::INT, Type::INTEGER => 'int',
124+
Type::INT => 'int',
125125
Type::INT64 => 'long',
126126
Type::FLOAT => 'double',
127127
Type::DECIMAL128 => 'decimal',
@@ -130,7 +130,7 @@ private function createEncryptedFieldsForClass(
130130
Type::OBJECTID => 'objectId',
131131
Type::STRING => 'string',
132132
Type::BINDATA, Type::BINDATABYTEARRAY, Type::BINDATAFUNC, Type::BINDATACUSTOM, Type::BINDATAUUID, Type::BINDATAMD5, Type::BINDATAUUIDRFC4122 => 'binData',
133-
Type::BOOL, Type::BOOLEAN => 'bool',
133+
Type::BOOL => 'bool',
134134
default => throw new LogicException(sprintf('Type "%s" is not supported in encrypted fields map.', $mapping['type'])),
135135
},
136136
'keyId' => null, // Generate the key automatically

tests/Tests/Types/TypeTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,9 @@ public static function provideTypes(): array
4646
{
4747
return [
4848
'id' => [Type::ID, '507f1f77bcf86cd799439011', new ObjectId('507f1f77bcf86cd799439011')],
49-
'intId' => [Type::INTID, 1],
5049
'customId' => [Type::CUSTOMID, (object) ['foo' => 'bar']],
5150
'bool' => [Type::BOOL, true],
52-
'boolean' => [Type::BOOLEAN, false],
5351
'int' => [Type::INT, 69],
54-
'integer' => [Type::INTEGER, 42],
5552
'int64' => [Type::INT64, 100, new Int64(100)],
5653
'float' => [Type::FLOAT, 3.14],
5754
'string' => [Type::STRING, 'ohai'],

0 commit comments

Comments
 (0)