diff --git a/doctrine/associations.rst b/doctrine/associations.rst index 64f763c9b6b..e1cd113ae22 100644 --- a/doctrine/associations.rst +++ b/doctrine/associations.rst @@ -228,7 +228,7 @@ class that will hold these objects: } /** - * @return Collection|Product[] + * @return Collection */ public function getProducts(): Collection { diff --git a/messenger/handler_results.rst b/messenger/handler_results.rst index 059738a4e79..e7bae04cbea 100644 --- a/messenger/handler_results.rst +++ b/messenger/handler_results.rst @@ -90,7 +90,7 @@ wherever you need a query bus behavior instead of the ``MessageBusInterface``:: * * @return mixed The handler returned value */ - public function query($query) + public function query($query): mixed { return $this->handle($query); } diff --git a/security/user_providers.rst b/security/user_providers.rst index c23302ee9a1..fe88f0cdf9a 100644 --- a/security/user_providers.rst +++ b/security/user_providers.rst @@ -311,8 +311,6 @@ command will generate a nice skeleton to get you started:: * * If your firewall is "stateless: true" (for a pure API), this * method is not called. - * - * @return UserInterface */ public function refreshUser(UserInterface $user): UserInterface { diff --git a/service_container/injection_types.rst b/service_container/injection_types.rst index 060a95bffc0..f1a6c80397b 100644 --- a/service_container/injection_types.rst +++ b/service_container/injection_types.rst @@ -180,8 +180,9 @@ In order to use this type of injection, don't forget to configure it: .. note:: If you decide to use autowiring, this type of injection requires - that you add a ``@return static`` docblock in order for the container - to be capable of registering the method. + that you add a ``@return static`` docblock or the ``static`` return + type in order for the container to be capable of registering + the method. This approach is useful if you need to configure your service according to your needs, so, here's the advantages of immutable-setters: