diff --git a/_posts/2024-06-13-slim-4.14.0-release.md b/_posts/2024-06-13-slim-4.14.0-release.md index 0941037b..53abbb28 100644 --- a/_posts/2024-06-13-slim-4.14.0-release.md +++ b/_posts/2024-06-13-slim-4.14.0-release.md @@ -7,4 +7,11 @@ layout: post We are pleased to have released Slim 4.14.0. As a mature release, there aren't many changes and all are minor and can be seen [here](https://github.com/slimphp/Slim/releases/tag/4.14.0). -Slim's docs are located [here](http://www.slimframework.com/docs/v4). +## Type hinting with template generics + +This release introduces of [template generic docblocks](https://phpstan.org/blog/generics-in-php-using-phpdocs) into Slim. If you type-hint `Slim\App` instance variable using `/** @var \Slim\App $app */`, then you will need to change it to either: + +* `/** @var \Slim\App $app */` if you are not using a DI container, or +* `/** @var \Slim\App<\Psr\Container\ContainerInterface> $app */` if you are. + +You can also type-hint to the concrete instance of the container you are using too. For example, if you are using [PHP-DI](https://php-di.org), then you can use: `/** @var \Slim\App $app */`.