Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DoctrineBundle] feat: doctrine schema subscribers as listeners #1635

Conversation

alli83
Copy link
Contributor

@alli83 alli83 commented Mar 10, 2023

linked to PR symfony/symfony#49610

Doctrine schema listeners are deprecated and changed as listeners

@alli83 alli83 force-pushed the doctrine-bundle-shema-subscribers-as-listeners branch from b27ef61 to e7e4a48 Compare March 10, 2023 17:00
@alli83
Copy link
Contributor Author

alli83 commented Mar 10, 2023

It seems the dependencies installed for psalm check are Symfony 5.4. It could explained why the class DoctrineDbalCacheAdapterSchemaListener is not found ?

psalm.xml.dist updated in order to suppress error

@alli83 alli83 force-pushed the doctrine-bundle-shema-subscribers-as-listeners branch from e7e4a48 to 8a6c21f Compare March 10, 2023 17:34
DependencyInjection/DoctrineExtension.php Outdated Show resolved Hide resolved
psalm.xml.dist Outdated Show resolved Hide resolved
@alli83 alli83 force-pushed the doctrine-bundle-shema-subscribers-as-listeners branch 2 times, most recently from 4409509 to 15c5c1c Compare March 12, 2023 06:40
@alli83
Copy link
Contributor Author

alli83 commented Mar 12, 2023

updated

@@ -394,18 +397,28 @@ protected function ormLoad(array $config, ContainerBuilder $container)
$container->removeAlias('doctrine.orm.metadata.annotation_reader');
}

// available in Symfony 6.3
class_exists(DoctrineDbalCacheAdapterSchemaListener::class) ?
Copy link
Member

@nicolas-grekas nicolas-grekas Mar 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$container->removeDefinition('doctrine.orm.listeners.doctrine_dbal_cache_adapter_schema_' . (class_exists(DoctrineDbalCacheAdapterSchemaListener::class) ? 'listener' : 'subscriber));
and let's do this also for pre-existing lines below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok ! if I'm not mistaken, there is just the case for the 3 new listeners. I'll double check

@alli83 alli83 force-pushed the doctrine-bundle-shema-subscribers-as-listeners branch from 15c5c1c to db7a166 Compare March 12, 2023 09:04
@alli83 alli83 force-pushed the doctrine-bundle-shema-subscribers-as-listeners branch from db7a166 to c435315 Compare March 12, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants