Skip to content

Commit

Permalink
Remove increment type
Browse files Browse the repository at this point in the history
  • Loading branch information
malarzm committed Jul 30, 2016
1 parent c515e77 commit 97dce7e
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 69 deletions.
4 changes: 0 additions & 4 deletions lib/Doctrine/ODM/MongoDB/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -1260,9 +1260,6 @@ public function mapField(array $mapping)
if (isset($mapping['type']) && $mapping['type'] === 'file') {
$mapping['file'] = true;
}
if (isset($mapping['type']) && $mapping['type'] === 'increment') {
$mapping['strategy'] = self::STORAGE_STRATEGY_INCREMENT;
}
if (isset($mapping['file']) && $mapping['file'] === true) {
$this->file = $mapping['fieldName'];
$mapping['name'] = 'file';
Expand Down Expand Up @@ -1395,7 +1392,6 @@ private function applyStorageStrategy(array &$mapping)
switch (true) {
case $mapping['type'] == 'int':
case $mapping['type'] == 'float':
case $mapping['type'] == 'increment':
$defaultStrategy = self::STORAGE_STRATEGY_SET;
$allowedStrategies = [self::STORAGE_STRATEGY_SET, self::STORAGE_STRATEGY_INCREMENT];
break;
Expand Down
49 changes: 0 additions & 49 deletions lib/Doctrine/ODM/MongoDB/Types/IncrementType.php

This file was deleted.

2 changes: 0 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Types/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ abstract class Type
const FILE = 'file';
const HASH = 'hash';
const COLLECTION = 'collection';
const INCREMENT = 'increment';
const OBJECTID = 'object_id';
const RAW = 'raw';

Expand Down Expand Up @@ -82,7 +81,6 @@ abstract class Type
self::FILE => Types\FileType::class,
self::HASH => Types\HashType::class,
self::COLLECTION => Types\CollectionType::class,
self::INCREMENT => Types\IncrementType::class,
self::OBJECTID => Types\ObjectIdType::class,
self::RAW => Types\RawType::class,
);
Expand Down
12 changes: 0 additions & 12 deletions tests/Doctrine/ODM/MongoDB/Tests/Mapping/ClassMetadataInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,18 +361,6 @@ public function testReferenceManySortMustNotBeUsedWithNonSetCollectionStrategy()
));
}

public function testIncrementTypeAutomaticallyAssumesIncrementStrategy()
{
$cm = new ClassMetadataInfo('stdClass');
$cm->mapField([
'fieldName' => 'incrementField',
'type' => 'increment',
]);

$mapping = $cm->fieldMappings['incrementField'];
$this->assertSame(ClassMetadataInfo::STORAGE_STRATEGY_INCREMENT, $mapping['strategy']);
}

public function testSetShardKeyForClassWithoutInheritance()
{
$cm = new ClassMetadataInfo('stdClass');
Expand Down
2 changes: 0 additions & 2 deletions tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ public function provideTypes()
array(Type::getType(Type::FILE), new GridFSFile()),
array(Type::getType(Type::HASH), array('foo' => 'bar')),
array(Type::getType(Type::COLLECTION), array('foo', 'bar')),
array(Type::getType(Type::INCREMENT), 1),
array(Type::getType(Type::INCREMENT), 1.1),
array(Type::getType(Type::OBJECTID), "507f1f77bcf86cd799439011"),
array(Type::getType(Type::RAW), (object) array('foo' => 'bar')),
);
Expand Down

0 comments on commit 97dce7e

Please sign in to comment.