Skip to content

Conversation

@d-mitrofanov-v
Copy link

Added assertions for notifier based on symfony NotificationAssertionsTrait

@d-mitrofanov-v d-mitrofanov-v marked this pull request as ready for review November 9, 2025 15:38
Copy link
Member

@TavoNiievez TavoNiievez left a comment

Choose a reason for hiding this comment

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

@d-mitrofanov-v Thank you for taking the time to add these new assertions!

All of these assertions were included in Symfony 6.2, and are not available in Symfony 5.4.

This module maintains the same support as the supported versions of Symfony, so we must ensure compatibility with Symfony 5.4 while it is still supported.

For a long time, I didn't think creating compatibility code was the most elegant option for this, which is why I kept putting off adding these assertions, but waiting until 2029 for SF 5.4 to become unsupported seems worse tbh.

So, Please add conditionals to each assertion to check that if the current version of Symfony is 5.4, you throw an exception explaining that these assertions are only available from SF 6.2 onwards (although in reality we only support 6.4+).

@TavoNiievez
Copy link
Member

You can use Symfony\Component\HttpKernel\Kernel::VERSION_ID to make this comparison, or use version_compare with Kernel::VERSION, both options are fine.

@d-mitrofanov-v
Copy link
Author

@TavoNiievez Thanks for review!

I've added check for a symfony version in getNotificationEvents() method as all assertions use it directly or indirectly

Copy link
Member

@TavoNiievez TavoNiievez left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants