Skip to content

Commit 3c1fd17

Browse files
committed
Upgrade symfony version
1 parent b77a5f6 commit 3c1fd17

File tree

5 files changed

+14
-22
lines changed

5 files changed

+14
-22
lines changed

.php-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0
1+
8.1

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">=8.0.2",
13+
"php": ">=8.1",
1414
"symfony/framework-bundle": "^6.0",
1515
"symfony/twig-bundle": "^6.0"
1616
},

src/Helper/NotificationHelper.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@ class NotificationHelper {
1919
const INFO_TYPE = "info";
2020
const INFORMATION_TYPE = "information";
2121

22-
private array $allowedTypes = ["alert", "success", "warning", "error", "info", "information"];
23-
private RequestStack $requestStack;
24-
private RouterInterface $router;
22+
private array $allowedTypes = ["alert", "success", "warning", "error", "info", "information"];
2523

2624
/**
2725
* @param RequestStack $requestStack
2826
* @param RouterInterface $router
2927
*/
30-
public function __construct(RequestStack $requestStack, RouterInterface $router) {
31-
$this->requestStack = $requestStack;
32-
$this->router = $router;
28+
public function __construct(
29+
protected readonly RequestStack $requestStack,
30+
protected readonly RouterInterface $router
31+
) {
3332
}
3433

3534
/**

src/Model/Notification.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,14 @@
44

55
class Notification {
66

7-
protected string $type;
8-
protected string $text;
9-
107
/**
11-
* Notification constructor.
12-
*
138
* @param string $type
149
* @param string $text
1510
*/
16-
public function __construct(string $type, string $text) {
17-
$this->type = $type;
18-
$this->text = $text;
11+
public function __construct(
12+
protected string $type,
13+
protected string $text
14+
) {
1915
}
2016

2117
/**

src/Twig/NotificationExtension.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,12 @@
1010

1111
class NotificationExtension extends AbstractExtension {
1212

13-
protected NotificationHelper $notificationHelper;
14-
1513
/**
16-
* NotificationExtension constructor.
17-
*
1814
* @param NotificationHelper $notificationHelper
1915
*/
20-
public function __construct(NotificationHelper $notificationHelper) {
21-
$this->notificationHelper = $notificationHelper;
16+
public function __construct(
17+
protected readonly NotificationHelper $notificationHelper
18+
) {
2219
}
2320

2421
/**

0 commit comments

Comments
 (0)