Skip to content

Commit d210ae7

Browse files
committed
config is readonly
1 parent 9c35dcd commit d210ae7

File tree

3 files changed

+2
-19
lines changed

3 files changed

+2
-19
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ parameters:
3030
count: 1
3131
path: src/Listener/ForceHttps.php
3232

33-
-
34-
message: '#^Property ForceHttpsModule\\Listener\\ForceHttps\:\:\$config type has no value type specified in iterable type array\.$#'
35-
identifier: missingType.iterableValue
36-
count: 1
37-
path: src/Listener/ForceHttps.php
38-
3933
-
4034
message: '#^Property ForceHttpsModule\\Listener\\ForceHttps\:\:\$needsWwwPrefix \(bool\) does not accept mixed\.$#'
4135
identifier: assign.propertyType
@@ -84,12 +78,6 @@ parameters:
8478
count: 1
8579
path: src/Middleware/ForceHttps.php
8680

87-
-
88-
message: '#^Property ForceHttpsModule\\Middleware\\ForceHttps\:\:\$config type has no value type specified in iterable type array\.$#'
89-
identifier: missingType.iterableValue
90-
count: 1
91-
path: src/Middleware/ForceHttps.php
92-
9381
-
9482
message: '#^Property ForceHttpsModule\\Middleware\\ForceHttps\:\:\$needsWwwPrefix \(bool\) does not accept mixed\.$#'
9583
identifier: assign.propertyType

src/Listener/ForceHttps.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ class ForceHttps extends AbstractListenerAggregate
2121
{
2222
use HttpsTrait;
2323

24-
private array $config;
25-
2624
/**
2725
* @param mixed[] $config
2826
*/
29-
public function __construct(array $config)
27+
public function __construct(private readonly array $config)
3028
{
31-
$this->config = $config;
3229
}
3330

3431
/**

src/Middleware/ForceHttps.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ class ForceHttps implements MiddlewareInterface
1616
{
1717
use HttpsTrait;
1818

19-
private array $config;
20-
2119
/**
2220
* @param mixed[] $config
2321
*/
24-
public function __construct(array $config, private RouterInterface $router)
22+
public function __construct(private array $config, private RouterInterface $router)
2523
{
2624
$this->config = $config;
2725
}

0 commit comments

Comments
 (0)