Closed mbretter closed 8 years ago
First see: https://github.com/slimphp/Slim/pull/1654
You can use this in your code:
/* @var \Slim\Interfaces\RouterInterface $router */
$router = $container->get('router');
sure, but I have to put this everytime into a var and write the phpdoc for it, instead of simply wrinting and geting the code completion: $container->router->whatever
I could put these docs myself by extending the containert, but Slim\Container has this f*\ final keyword, no chance to make a subclass and put my @property-reads there. academic vs. practical solution
since the final keyword has been removed, this could be done by inheriting from Container and adding property-reads
within the \Slim\Container there are @property-read hints which helps, but they are returning the Interface type not the real one, so some methods are always missing:
@property-read \Psr\Http\Message\ServerRequestInterface request does not show isPut, isGet etc.
@property-read \Slim\Http\Request|\Psr\Http\Message\ServerRequestInterface request would show the additional methods beyond PSR-7 spec to, which would help a lot, atm I have to dig into the source code, to find the additional methods.