Skip to content

Commit 0ec154d

Browse files
committed
reduce ignore errors on phpstan baseline
1 parent 9b9e1b5 commit 0ec154d

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ parameters:
1212
count: 2
1313
path: src/Listener/ForceHttps.php
1414

15-
-
16-
message: '#^Method ForceHttpsModule\\Listener\\ForceHttps\:\:isGoingToBeForcedToHttps\(\) should return bool but returns mixed\.$#'
17-
identifier: return.type
18-
count: 1
19-
path: src/Listener/ForceHttps.php
20-
2115
-
2216
message: '#^Parameter \#2 \$haystack of function in_array expects array, mixed given\.$#'
2317
identifier: argument.type
@@ -30,12 +24,6 @@ parameters:
3024
count: 1
3125
path: src/Listener/ForceHttps.php
3226

33-
-
34-
message: '#^Property ForceHttpsModule\\Listener\\ForceHttps\:\:\$needsWwwPrefix \(bool\) does not accept mixed\.$#'
35-
identifier: assign.propertyType
36-
count: 1
37-
path: src/Listener/ForceHttps.php
38-
3927
-
4028
message: '#^Cannot access offset ''force\-https\-module'' on mixed\.$#'
4129
identifier: offsetAccess.nonOffsetAccessible
@@ -60,12 +48,6 @@ parameters:
6048
count: 2
6149
path: src/Middleware/ForceHttps.php
6250

63-
-
64-
message: '#^Method ForceHttpsModule\\Middleware\\ForceHttps\:\:isGoingToBeForcedToHttps\(\) should return bool but returns mixed\.$#'
65-
identifier: return.type
66-
count: 1
67-
path: src/Middleware/ForceHttps.php
68-
6951
-
7052
message: '#^Parameter \#2 \$haystack of function in_array expects array, mixed given\.$#'
7153
identifier: argument.type
@@ -78,12 +60,6 @@ parameters:
7860
count: 1
7961
path: src/Middleware/ForceHttps.php
8062

81-
-
82-
message: '#^Property ForceHttpsModule\\Middleware\\ForceHttps\:\:\$needsWwwPrefix \(bool\) does not accept mixed\.$#'
83-
identifier: assign.propertyType
84-
count: 1
85-
path: src/Middleware/ForceHttps.php
86-
8763
-
8864
message: '#^Cannot access offset ''force\-https\-module'' on mixed\.$#'
8965
identifier: offsetAccess.nonOffsetAccessible

src/HttpsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private function isSchemeHttps(string $uriScheme): bool
2828
private function isGoingToBeForcedToHttps(RouteMatch|RouteResult|null $match = null): bool
2929
{
3030
if ($match === null || ($match instanceof RouteResult && $match->isFailure())) {
31-
return $this->config['allow_404'] ?? false;
31+
return (bool) ($this->config['allow_404'] ?? false);
3232
}
3333

3434
$matchedRouteName = $match->getMatchedRouteName();
@@ -61,7 +61,7 @@ private function isSkippedHttpStrictTransportSecurity(
6161
*/
6262
private function withWwwPrefixWhenRequired(string $httpsRequestUri): string
6363
{
64-
$this->needsWwwPrefix = $this->config['add_www_prefix'] ?? false;
64+
$this->needsWwwPrefix = (bool) ($this->config['add_www_prefix'] ?? false);
6565
$this->alreadyHasWwwPrefix = strpos($httpsRequestUri, 'www.', 8) === 8;
6666

6767
if (! $this->needsWwwPrefix || $this->alreadyHasWwwPrefix) {

0 commit comments

Comments
 (0)