Skip to content

Commit b4afee9

Browse files
committed
Fixed: Removed phpstan errors
1 parent 3daffb7 commit b4afee9

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

phpstan.neon

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,3 @@ parameters:
66
parallel:
77
maximumNumberOfProcesses: 1
88
treatPhpDocTypesAsCertain: false
9-
ignoreErrors:
10-
-
11-
message: '%Parameter #1 \$value of method Zaphyr\\HttpMessage\\Uri::sanitizeQueryOrFragment\(\) expects string, string\|null given.%'
12-
path: 'src/Uri.php'
13-
-
14-
message: '%Parameter #2 \$length of function fread expects int<0, max>, int given.%'
15-
path: 'src/Stream.php'

src/Stream.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ public function read(int $length): string
257257
throw new RuntimeException('Stream is not readable');
258258
}
259259

260+
/** @var int<1, max> $length */
260261
$result = fread($this->resource, $length);
261262

262263
if ($result === false) {

src/UploadedFile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function moveTo(string $targetPath): void
131131
);
132132
}
133133

134-
if (!$this->file || empty(PHP_SAPI) || str_starts_with(PHP_SAPI, 'cli')) {
134+
if (!$this->file || PHP_SAPI === 'cli') {
135135
$handle = fopen($targetPath, 'wb+');
136136

137137
if ($handle === false) {

src/Uri.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -379,13 +379,13 @@ private function sanitizeQuery(string $query): string
379379
[$key, $value] = $this->splitQueryValue($part);
380380

381381
if ($value === null) {
382-
$parts[$index] = $this->sanitizeQueryOrFragment($key);
382+
$parts[$index] = $this->sanitizeQueryOrFragment((string)$key);
383383
continue;
384384
}
385385

386386
$parts[$index] = sprintf(
387387
'%s=%s',
388-
$this->sanitizeQueryOrFragment($key),
388+
$this->sanitizeQueryOrFragment((string)$key),
389389
$this->sanitizeQueryOrFragment($value)
390390
);
391391
}

0 commit comments

Comments
 (0)