From 2a5464f1fa4544e163be1a59a80c5c75b7197d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BDernovi=C4=8D?= Date: Fri, 23 Jan 2026 10:10:26 +0100 Subject: [PATCH] change Inject from PHPDoc format to native PHP attribute --- CHANGELOG.md | 1 + src/Presenters/ApiPresenter.php | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f0e48..77fc0dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased][unreleased] ### Changed * update minimum PHP to version 8.2 (currently still supported version) + update league/fractal library [BC] +* change Inject from PHPDoc format to native PHP attribute ## 3.2.0 diff --git a/src/Presenters/ApiPresenter.php b/src/Presenters/ApiPresenter.php index 1a11d84..53ea901 100644 --- a/src/Presenters/ApiPresenter.php +++ b/src/Presenters/ApiPresenter.php @@ -7,6 +7,7 @@ use Nette\Application\IPresenter; use Nette\Application\IResponse; use Nette\Application\Request; +use Nette\DI\Attributes\Inject; use Nette\DI\Container; use Nette\Http\Response; use Throwable; @@ -27,20 +28,20 @@ final class ApiPresenter implements IPresenter private const HTTP_PORT = 80; - /** @var ApiDecider @inject */ - public $apiDecider; + #[Inject] + public ApiDecider $apiDecider; - /** @var Response @inject */ - public $response; + #[Inject] + public Response $response; - /** @var Container @inject */ - public $context; + #[Inject] + public Container $context; - /** @var ConfiguratorInterface @inject */ - public $outputConfigurator; + #[Inject] + public ConfiguratorInterface $outputConfigurator; - /** @var ErrorHandlerInterface @inject */ - public $errorHandler; + #[Inject] + public ErrorHandlerInterface $errorHandler; /** * CORS header settings