Skip to content

Commit

Permalink
Add support for disabling type comments in the schema
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Oct 23, 2023
1 parent d0e2a33 commit 2ed5379
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ private function getDbalConnectionsNode(): ArrayNodeDefinition
->defaultValue(true)
->info('Enables collecting schema errors when profiling is enabled')
->end()
->booleanNode('disable_type_comments')->end()
->scalarNode('server_version')->end()
->scalarNode('driver_class')->end()
->scalarNode('wrapper_class')->end()
Expand Down
6 changes: 6 additions & 0 deletions DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ protected function loadDbalConnection($name, array $connection, ContainerBuilder

unset($connection['auto_commit']);

if (isset($connection['disable_type_comments'])) {
$configuration->addMethodCall('setDisableTypeComments', [$connection['disable_type_comments']]);
}

unset($connection['disable_type_comments']);

if (isset($connection['schema_filter']) && $connection['schema_filter']) {
$definition = new Definition(RegexSchemaAssetFilter::class, [$connection['schema_filter']]);
$definition->addTag('doctrine.dbal.schema_filter', ['connection' => $name]);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"require": {
"php": "^7.4 || ^8.0",
"doctrine/cache": "^1.11 || ^2.0",
"doctrine/dbal": "^3.6.0",
"doctrine/dbal": "^3.7.0",
"doctrine/persistence": "^2.2 || ^3",
"doctrine/sql-formatter": "^1.0.1",
"symfony/cache": "^5.4 || ^6.0 || ^7.0",
Expand Down

0 comments on commit 2ed5379

Please sign in to comment.