Skip to content

Commit 93225d2

Browse files
Merge branch '5.2' into 5.3
* 5.2: Backport type fixes Fix CS Avoid triggering the autoloader in Deprecation::isLegacy() fix markdown markup Backport type fixes uzb translation [DependencyInjection] Fix doc blocks [DependencyInjection] Turn $defaultDeprecationTemplate into a constant [Form] better form doc types to support static analysis
2 parents 46aa709 + e24d8fc commit 93225d2

File tree

8 files changed

+23
-28
lines changed

8 files changed

+23
-28
lines changed

Caster/DOMCaster.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public static function castLength($dom, array $a, Stub $stub, bool $isNested)
8282
return $a;
8383
}
8484

85-
public static function castImplementation($dom, array $a, Stub $stub, bool $isNested)
85+
public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested)
8686
{
8787
$a += [
8888
Caster::PREFIX_VIRTUAL.'Core' => '1.0',

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/RdKafkaCaster.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
*/
3232
class RdKafkaCaster
3333
{
34-
public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, $isNested)
34+
public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub, bool $isNested)
3535
{
3636
$prefix = Caster::PREFIX_VIRTUAL;
3737

@@ -51,7 +51,7 @@ public static function castKafkaConsumer(KafkaConsumer $c, array $a, Stub $stub,
5151
return $a;
5252
}
5353

54-
public static function castTopic(Topic $c, array $a, Stub $stub, $isNested)
54+
public static function castTopic(Topic $c, array $a, Stub $stub, bool $isNested)
5555
{
5656
$prefix = Caster::PREFIX_VIRTUAL;
5757

@@ -75,7 +75,7 @@ public static function castTopicPartition(TopicPartition $c, array $a)
7575
return $a;
7676
}
7777

78-
public static function castMessage(Message $c, array $a, Stub $stub, $isNested)
78+
public static function castMessage(Message $c, array $a, Stub $stub, bool $isNested)
7979
{
8080
$prefix = Caster::PREFIX_VIRTUAL;
8181

@@ -86,7 +86,7 @@ public static function castMessage(Message $c, array $a, Stub $stub, $isNested)
8686
return $a;
8787
}
8888

89-
public static function castConf(Conf $c, array $a, Stub $stub, $isNested)
89+
public static function castConf(Conf $c, array $a, Stub $stub, bool $isNested)
9090
{
9191
$prefix = Caster::PREFIX_VIRTUAL;
9292

@@ -97,7 +97,7 @@ public static function castConf(Conf $c, array $a, Stub $stub, $isNested)
9797
return $a;
9898
}
9999

100-
public static function castTopicConf(TopicConf $c, array $a, Stub $stub, $isNested)
100+
public static function castTopicConf(TopicConf $c, array $a, Stub $stub, bool $isNested)
101101
{
102102
$prefix = Caster::PREFIX_VIRTUAL;
103103

@@ -108,7 +108,7 @@ public static function castTopicConf(TopicConf $c, array $a, Stub $stub, $isNest
108108
return $a;
109109
}
110110

111-
public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, $isNested)
111+
public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, bool $isNested)
112112
{
113113
$prefix = Caster::PREFIX_VIRTUAL;
114114

@@ -121,14 +121,14 @@ public static function castRdKafka(\RdKafka $c, array $a, Stub $stub, $isNested)
121121
return $a;
122122
}
123123

124-
public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, $isNested)
124+
public static function castCollectionMetadata(CollectionMetadata $c, array $a, Stub $stub, bool $isNested)
125125
{
126126
$a += iterator_to_array($c);
127127

128128
return $a;
129129
}
130130

131-
public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, $isNested)
131+
public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub, bool $isNested)
132132
{
133133
$prefix = Caster::PREFIX_VIRTUAL;
134134

@@ -140,7 +140,7 @@ public static function castTopicMetadata(TopicMetadata $c, array $a, Stub $stub,
140140
return $a;
141141
}
142142

143-
public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, $isNested)
143+
public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stub $stub, bool $isNested)
144144
{
145145
$prefix = Caster::PREFIX_VIRTUAL;
146146

@@ -153,7 +153,7 @@ public static function castPartitionMetadata(PartitionMetadata $c, array $a, Stu
153153
return $a;
154154
}
155155

156-
public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, $isNested)
156+
public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stub, bool $isNested)
157157
{
158158
$prefix = Caster::PREFIX_VIRTUAL;
159159

Caster/ResourceCaster.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function castProcess($process, array $a, Stub $stub, bool $isNeste
4848
public static function castStream($stream, array $a, Stub $stub, bool $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

@@ -60,7 +60,7 @@ public static function castStreamContext($stream, array $a, Stub $stub, bool $is
6060
return @stream_context_get_params($stream) ?: $a;
6161
}
6262

63-
public static function castGd($gd, array $a, Stub $stub, $isNested)
63+
public static function castGd($gd, array $a, Stub $stub, bool $isNested)
6464
{
6565
$a['size'] = imagesx($gd).'x'.imagesy($gd);
6666
$a['trueColor'] = imageistruecolor($gd);

Caster/SplCaster.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static function castArrayIterator(\ArrayIterator $c, array $a, Stub $stub
3939
return self::castSplArray($c, $a, $stub, $isNested);
4040
}
4141

42-
public static function castHeap(\Iterator $c, array $a, Stub $stub, $isNested)
42+
public static function castHeap(\Iterator $c, array $a, Stub $stub, bool $isNested)
4343
{
4444
$a += [
4545
Caster::PREFIX_VIRTUAL.'heap' => iterator_to_array(clone $c),
@@ -129,7 +129,7 @@ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool
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/CliDumper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int
324324
* @param bool $hasChild When the dump of the hash has child item
325325
* @param int $cut The number of items the hash has been cut by
326326
*/
327-
protected function dumpEllipsis(Cursor $cursor, $hasChild, $cut)
327+
protected function dumpEllipsis(Cursor $cursor, bool $hasChild, int $cut)
328328
{
329329
if ($cut) {
330330
$this->line .= '';
@@ -428,7 +428,7 @@ protected function dumpKey(Cursor $cursor)
428428
*
429429
* @return string The value with style decoration
430430
*/
431-
protected function style($style, $value, $attr = [])
431+
protected function style(string $style, string $value, array $attr = [])
432432
{
433433
if (null === $this->colors) {
434434
$this->colors = $this->supportsColors();

Dumper/HtmlDumper.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,16 @@ public function setDisplayOptions(array $displayOptions)
116116

117117
/**
118118
* Sets an HTML header that will be dumped once in the output stream.
119-
*
120-
* @param string $header An HTML string
121119
*/
122-
public function setDumpHeader($header)
120+
public function setDumpHeader(string $header)
123121
{
124122
$this->dumpHeader = $header;
125123
}
126124

127125
/**
128126
* Sets an HTML prefix and suffix that will encapse every single dump.
129-
*
130-
* @param string $prefix The prepended HTML string
131-
* @param string $suffix The appended HTML string
132127
*/
133-
public function setDumpBoundaries($prefix, $suffix)
128+
public function setDumpBoundaries(string $prefix, string $suffix)
134129
{
135130
$this->dumpPrefix = $prefix;
136131
$this->dumpSuffix = $suffix;
@@ -851,7 +846,7 @@ public function leaveHash(Cursor $cursor, int $type, $class, bool $hasChild, int
851846
/**
852847
* {@inheritdoc}
853848
*/
854-
protected function style($style, $value, $attr = [])
849+
protected function style(string $style, string $value, array $attr = [])
855850
{
856851
if ('' === $value) {
857852
return '';
@@ -985,7 +980,7 @@ private function getSourceLink(string $file, int $line)
985980
}
986981
}
987982

988-
function esc($str)
983+
function esc(string $str)
989984
{
990985
return htmlspecialchars($str, \ENT_QUOTES, 'UTF-8');
991986
}

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)