This code returns object (of any class). I use generic method in example, see screenshot. Psalm and phpstan provide it as additional syntax and typing extension. Psalm and phpstan correctly understands this syntax construction, this construction cannot be written otherwise due to dynamic typing. But SonarQube marks as php:S1488.
Thank you for the clarification. I still wonder why you did not set the return type to TService instead of object. And do I get it correctly that the phpDoc is only for Pslam and PhpStan?
I still wonder why you did not set the return type to TService instead of object
I use service-container (as service-locator in this place of my project) from vendor package, it returns object and not generic unfortunately. I create a generic manually through phpDoc.
And do I get it correctly that the phpDoc is only for Pslam and PhpStan?