StofDoctrineExtensionsBundle
StofDoctrineExtensionsBundle copied to clipboard
feat: suppress deprecation warnings for getSubscribedEvents()
hi @stof, could you merge it into a new TAG to fix the deprecated message?
thanks in advance and thanks for this bundle!
which deprecation warnings is this suppressing ?
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.
This @inheritdoc
will not remove that deprecation though. Only an explicit @return array
will skip the warning.
Should i change it to @return array or @return array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>> ?
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.