Skip to content

Commit 78921fb

Browse files
jzernovicJakub Žernovič
andauthored
change Inject from PHPDoc format to native PHP attribute (#168)
Co-authored-by: Jakub Žernovič <zernovic@efabrica.sk>
1 parent a841f7c commit 78921fb

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
55
## [Unreleased][unreleased]
66
### Changed
77
* update minimum PHP to version 8.2 (currently still supported version) + update league/fractal library [BC]
8+
* change Inject from PHPDoc format to native PHP attribute
89

910
## 3.2.0
1011

src/Presenters/ApiPresenter.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Nette\Application\IPresenter;
88
use Nette\Application\IResponse;
99
use Nette\Application\Request;
10+
use Nette\DI\Attributes\Inject;
1011
use Nette\DI\Container;
1112
use Nette\Http\Response;
1213
use Throwable;
@@ -27,20 +28,20 @@ final class ApiPresenter implements IPresenter
2728

2829
private const HTTP_PORT = 80;
2930

30-
/** @var ApiDecider @inject */
31-
public $apiDecider;
31+
#[Inject]
32+
public ApiDecider $apiDecider;
3233

33-
/** @var Response @inject */
34-
public $response;
34+
#[Inject]
35+
public Response $response;
3536

36-
/** @var Container @inject */
37-
public $context;
37+
#[Inject]
38+
public Container $context;
3839

39-
/** @var ConfiguratorInterface @inject */
40-
public $outputConfigurator;
40+
#[Inject]
41+
public ConfiguratorInterface $outputConfigurator;
4142

42-
/** @var ErrorHandlerInterface @inject */
43-
public $errorHandler;
43+
#[Inject]
44+
public ErrorHandlerInterface $errorHandler;
4445

4546
/**
4647
* CORS header settings

0 commit comments

Comments
 (0)