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

feat: suppress deprecation warnings for getSubscribedEvents() #476

Closed
wants to merge 3 commits into from

Conversation

Chris53897
Copy link

No description provided.

@ceponcet
Copy link

hi @stof, could you merge it into a new TAG to fix the deprecated message?

thanks in advance and thanks for this bundle!

@stof
Copy link
Owner

stof commented Jun 10, 2024

which deprecation warnings is this suppressing ?

@Chris53897
Copy link
Author

Chris53897 commented Jun 10, 2024

Method "Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()" might add "array" as a native return type declaration in the future. Do the same in implementation "Stof\DoctrineExtensionsBundle\EventListener\LoggerListener" now to avoid errors or add an explicit @return annotation to suppress this message.

@stof
Copy link
Owner

stof commented Jun 10, 2024

This @inheritdoc will not remove that deprecation though. Only an explicit @return array will skip the warning.

@Chris53897
Copy link
Author

Should i change it to @return array or
@return array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>>
?

@subiabre
Copy link

array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>>

Seems unnecessarily complicated for a method meant to be used by Symfony and not really by other developers in their code. Symfony's documentation shows a simple array for this specific use case as well as for the vast majority of remaining examples.

Also, such level of details increases the chances of having to update the annotation if in the future the shape of the array changes.

@stof
Copy link
Owner

stof commented Aug 29, 2024

Closing in favor of #489

@stof stof closed this Aug 29, 2024
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.

5 participants