stof / StofDoctrineExtensionsBundle

Integration bundle for DoctrineExtensions by l3pp4rd in Symfony
https://symfony.com/bundles/StofDoctrineExtensionsBundle/current/index.html
MIT License
1.89k stars 380 forks source link

feat: suppress deprecation warnings for getSubscribedEvents() #476

Closed Chris53897 closed 2 weeks ago

ceponcet commented 3 months ago

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

thanks in advance and thanks for this bundle!

stof commented 3 months ago

which deprecation warnings is this suppressing ?

Chris53897 commented 3 months ago

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 commented 3 months ago

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

Chris53897 commented 3 months ago

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

subiabre commented 2 months ago

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 commented 2 weeks ago

Closing in favor of #489