Skip to content

Commit 6153ced

Browse files
Backport type fixes
1 parent a586efd commit 6153ced

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Caster/LinkStub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class LinkStub extends ConstStub
2323
private static $vendorRoots;
2424
private static $composerRoots;
2525

26-
public function __construct($label, int $line = 0, $href = null)
26+
public function __construct(string $label, int $line = 0, string $href = null)
2727
{
2828
$this->value = $label;
2929

Caster/ResourceCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function castProcess($process, array $a, Stub $stub, $isNested)
4848
public static function castStream($stream, array $a, Stub $stub, $isNested)
4949
{
5050
$a = stream_get_meta_data($stream) + static::castStreamContext($stream, $a, $stub, $isNested);
51-
if (isset($a['uri'])) {
51+
if ($a['uri'] ?? false) {
5252
$a['uri'] = new LinkStub($a['uri']);
5353
}
5454

Caster/SplCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, $isNe
129129
}
130130
}
131131

132-
if (isset($a[$prefix.'realPath'])) {
132+
if ($a[$prefix.'realPath'] ?? false) {
133133
$a[$prefix.'realPath'] = new LinkStub($a[$prefix.'realPath']);
134134
}
135135

Dumper/HtmlDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ private function getSourceLink(string $file, int $line)
998998
}
999999
}
10001000

1001-
function esc($str)
1001+
function esc(string $str)
10021002
{
10031003
return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8');
10041004
}

Server/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function write(Data $data): bool
7878
return false;
7979
}
8080

81-
private static function nullErrorHandler($t, $m)
81+
private static function nullErrorHandler(int $t, string $m)
8282
{
8383
// no-op
8484
}

0 commit comments

Comments
 (0)