Skip to content

Commit 34d82ce

Browse files
authored
Merge pull request #2054 from greg0ire/remove-disable-type-comments
Remove `disable_type_comments`
2 parents 6821ae8 + 193ed3b commit 34d82ce

File tree

8 files changed

+5
-107
lines changed

8 files changed

+5
-107
lines changed

UPGRADE-3.0.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ There is no replacement for this option.
6969
The `commented` option for custom types is no longer supported and has been
7070
removed.
7171

72+
### The `doctrine.dbal.connection.some_connection.disable_type_comments` option is removed
73+
74+
The `disable_type_comments` option for connections is no longer supported and has
75+
been removed.
76+
7277
### The `doctrine.dbal.connection.some_connection.platform_service` option is removed
7378

7479
The `platform_service` option for connections is no longer supported and has

config/schema/doctrine-1.0.xsd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
<xsd:attribute name="schema-manager-factory" type="xsd:string" />
4040
<xsd:attribute name="result-cache" type="xsd:string" />
4141
<xsd:attribute name="use-savepoints" type="xsd:boolean" />
42-
<xsd:attribute name="disable-type-comments" type="xsd:boolean" />
4342
<xsd:attributeGroup ref="driver-config" />
4443
</xsd:attributeGroup>
4544

docs/en/configuration.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ Configuration Reference
110110
# When true, profiling also collects schema errors for each query
111111
profiling_collect_schema_errors: true
112112
113-
# When true, type comments are skipped in the database schema, matching the behavior of DBAL 4.
114-
# This requires using the non-deprecated schema comparison APIs of DBAL.
115-
disable_type_comments: false
116-
117113
server_version: ~
118114
driver_class: ~
119115
# Allows to specify a custom wrapper implementation to use.
@@ -423,7 +419,6 @@ Configuration Reference
423419
profiling="%kernel.debug%"
424420
profiling-collect-backtrace="false"
425421
profiling-collect-schema-errors="true"
426-
disable-type-comments="false"
427422
server-version=""
428423
driver-class=""
429424
wrapper-class=""

src/DependencyInjection/Configuration.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace Doctrine\Bundle\DoctrineBundle\DependencyInjection;
66

7-
use Doctrine\DBAL\Connection;
8-
use Doctrine\Deprecations\Deprecation;
97
use Doctrine\ORM\EntityManager;
108
use Doctrine\ORM\EntityRepository;
119
use Doctrine\ORM\Mapping\ClassMetadata;
@@ -31,7 +29,6 @@
3129
use function is_array;
3230
use function is_string;
3331
use function key;
34-
use function method_exists;
3532
use function reset;
3633
use function sprintf;
3734
use function strtoupper;
@@ -188,20 +185,6 @@ private function getDbalConnectionsNode(): ArrayNodeDefinition
188185
->defaultValue(true)
189186
->info('Enables collecting schema errors when profiling is enabled')
190187
->end()
191-
->booleanNode('disable_type_comments')
192-
->beforeNormalization()
193-
->ifTrue(static fn ($v): bool => isset($v) && ! method_exists(Connection::class, 'getEventManager'))
194-
->then(static function ($v) {
195-
Deprecation::trigger(
196-
'doctrine/doctrine-bundle',
197-
'https://github.com/doctrine/DoctrineBundle/pull/2048',
198-
'The "disable_type_comments" configuration key is deprecated when using DBAL 4 and will be removed in DoctrineBundle 3.0.',
199-
);
200-
201-
return $v;
202-
})
203-
->end()
204-
->end()
205188
->scalarNode('server_version')->end()
206189
->integerNode('idle_connection_ttl')->defaultValue(600)->end()
207190
->scalarNode('driver_class')->end()

src/DependencyInjection/DoctrineExtension.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,6 @@ protected function loadDbalConnection(string $name, array $connection, Container
262262

263263
unset($connection['auto_commit']);
264264

265-
if (isset($connection['disable_type_comments'])) {
266-
$configuration->addMethodCall('setDisableTypeComments', [$connection['disable_type_comments']]);
267-
}
268-
269-
unset($connection['disable_type_comments']);
270-
271265
if (isset($connection['schema_filter']) && $connection['schema_filter']) {
272266
$definition = new Definition(RegexSchemaAssetFilter::class, [$connection['schema_filter']]);
273267
$definition->addTag('doctrine.dbal.schema_filter', ['connection' => $name]);

tests/DependencyInjection/AbstractDoctrineExtensionTestCase.php

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@
99
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
1010
use Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\Fixtures\InvokableEntityListener;
1111
use Doctrine\DBAL\Configuration;
12-
use Doctrine\DBAL\Connection;
1312
use Doctrine\DBAL\Connections\PrimaryReadReplicaConnection;
1413
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
15-
use Doctrine\Deprecations\PHPUnit\VerifyDeprecations;
1614
use Doctrine\ORM\EntityManager;
1715
use Doctrine\ORM\EntityManagerInterface;
1816
use Doctrine\ORM\Mapping\ClassMetadata;
@@ -43,7 +41,6 @@
4341
use function end;
4442
use function interface_exists;
4543
use function is_dir;
46-
use function method_exists;
4744
use function sprintf;
4845
use function sys_get_temp_dir;
4946
use function uniqid;
@@ -52,8 +49,6 @@
5249

5350
abstract class AbstractDoctrineExtensionTestCase extends TestCase
5451
{
55-
use VerifyDeprecations;
56-
5752
abstract protected function loadFromFile(ContainerBuilder $container, string $file): void;
5853

5954
public function testDbalLoadFromXmlMultipleConnections(): void
@@ -191,26 +186,6 @@ public function testDbalLoadSinglePrimaryReplicaConnection(): void
191186
$this->assertEquals(['engine' => 'InnoDB'], $param['defaultTableOptions']);
192187
}
193188

194-
public function testDbalLoadDisableTypeComments(): void
195-
{
196-
$container = $this->loadContainer('dbal_disable_type_comments');
197-
198-
$calls = $container->getDefinition('doctrine.dbal.no_comments_connection.configuration')->getMethodCalls();
199-
$calls = array_values(array_filter($calls, static fn ($call) => $call[0] === 'setDisableTypeComments'));
200-
$this->assertCount(1, $calls);
201-
$this->assertEquals('setDisableTypeComments', $calls[0][0]);
202-
$this->assertTrue($calls[0][1][0]);
203-
204-
$calls = $container->getDefinition('doctrine.dbal.comments_connection.configuration')->getMethodCalls();
205-
$calls = array_values(array_filter($calls, static fn ($call) => $call[0] === 'setDisableTypeComments'));
206-
$this->assertCount(1, $calls);
207-
$this->assertFalse($calls[0][1][0]);
208-
209-
$calls = $container->getDefinition('doctrine.dbal.notset_connection.configuration')->getMethodCalls();
210-
$calls = array_values(array_filter($calls, static fn ($call) => $call[0] === 'setDisableTypeComments'));
211-
$this->assertCount(0, $calls);
212-
}
213-
214189
#[IgnoreDeprecations]
215190
public function testDbalSchemaManagerFactory(): void
216191
{
@@ -800,27 +775,6 @@ public function testAddFilter(): void
800775
$this->assertCount(2, $entityManager->getFilters()->getEnabledFilters());
801776
}
802777

803-
#[IgnoreDeprecations]
804-
public function testSettingDisableTypeCommentsWithDbal4IsDeprecated(): void
805-
{
806-
if (method_exists(Connection::class, 'getEventManager')) {
807-
self::markTestSkipped('This test requires DBAL 4.');
808-
}
809-
810-
$this->expectDeprecationWithIdentifier('https://github.com/doctrine/DoctrineBundle/pull/2048');
811-
$this->loadContainer('dbal_disable_type_comments');
812-
}
813-
814-
public function testSettingDisableTypeCommentsWithDbal3IsFine(): void
815-
{
816-
if (! method_exists(Connection::class, 'getEventManager')) {
817-
self::markTestSkipped('This test requires DBAL 3.');
818-
}
819-
820-
$this->expectNoDeprecationWithIdentifier('https://github.com/doctrine/DoctrineBundle/pull/2048');
821-
$this->loadContainer('dbal_disable_type_comments');
822-
}
823-
824778
public function testResolveTargetEntity(): void
825779
{
826780
if (! interface_exists(EntityManagerInterface::class)) {

tests/DependencyInjection/Fixtures/config/xml/dbal_disable_type_comments.xml

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

tests/DependencyInjection/Fixtures/config/yml/dbal_disable_type_comments.yml

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

0 commit comments

Comments
 (0)