Skip to content

Commit 129d0c0

Browse files
wouterjnicolas-grekas
authored andcommitted
Add missing PHPdoc return types
1 parent 54f93ba commit 129d0c0

21 files changed

+309
-0
lines changed

Caster/AmqpCaster.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ class AmqpCaster
4646
\AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS',
4747
];
4848

49+
/**
50+
* @return array
51+
*/
4952
public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested)
5053
{
5154
$prefix = Caster::PREFIX_VIRTUAL;
@@ -79,6 +82,9 @@ public static function castConnection(\AMQPConnection $c, array $a, Stub $stub,
7982
return $a;
8083
}
8184

85+
/**
86+
* @return array
87+
*/
8288
public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested)
8389
{
8490
$prefix = Caster::PREFIX_VIRTUAL;
@@ -102,6 +108,9 @@ public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $
102108
return $a;
103109
}
104110

111+
/**
112+
* @return array
113+
*/
105114
public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested)
106115
{
107116
$prefix = Caster::PREFIX_VIRTUAL;
@@ -125,6 +134,9 @@ public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNe
125134
return $a;
126135
}
127136

137+
/**
138+
* @return array
139+
*/
128140
public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested)
129141
{
130142
$prefix = Caster::PREFIX_VIRTUAL;
@@ -153,6 +165,9 @@ public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool
153165
return $a;
154166
}
155167

168+
/**
169+
* @return array
170+
*/
156171
public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
157172
{
158173
$prefix = Caster::PREFIX_VIRTUAL;

Caster/DOMCaster.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ class DOMCaster
6363
\XML_NAMESPACE_DECL_NODE => 'XML_NAMESPACE_DECL_NODE',
6464
];
6565

66+
/**
67+
* @return array
68+
*/
6669
public static function castException(\DOMException $e, array $a, Stub $stub, bool $isNested)
6770
{
6871
$k = Caster::PREFIX_PROTECTED.'code';
@@ -73,6 +76,9 @@ public static function castException(\DOMException $e, array $a, Stub $stub, boo
7376
return $a;
7477
}
7578

79+
/**
80+
* @return array
81+
*/
7682
public static function castLength($dom, array $a, Stub $stub, bool $isNested)
7783
{
7884
$a += [
@@ -82,6 +88,9 @@ public static function castLength($dom, array $a, Stub $stub, bool $isNested)
8288
return $a;
8389
}
8490

91+
/**
92+
* @return array
93+
*/
8594
public static function castImplementation(\DOMImplementation $dom, array $a, Stub $stub, bool $isNested)
8695
{
8796
$a += [
@@ -92,6 +101,9 @@ public static function castImplementation(\DOMImplementation $dom, array $a, Stu
92101
return $a;
93102
}
94103

104+
/**
105+
* @return array
106+
*/
95107
public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNested)
96108
{
97109
$a += [
@@ -116,6 +128,9 @@ public static function castNode(\DOMNode $dom, array $a, Stub $stub, bool $isNes
116128
return $a;
117129
}
118130

131+
/**
132+
* @return array
133+
*/
119134
public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub $stub, bool $isNested)
120135
{
121136
$a += [
@@ -132,6 +147,9 @@ public static function castNameSpaceNode(\DOMNameSpaceNode $dom, array $a, Stub
132147
return $a;
133148
}
134149

150+
/**
151+
* @return array
152+
*/
135153
public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, bool $isNested, int $filter = 0)
136154
{
137155
$a += [
@@ -166,6 +184,9 @@ public static function castDocument(\DOMDocument $dom, array $a, Stub $stub, boo
166184
return $a;
167185
}
168186

187+
/**
188+
* @return array
189+
*/
169190
public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub $stub, bool $isNested)
170191
{
171192
$a += [
@@ -176,6 +197,9 @@ public static function castCharacterData(\DOMCharacterData $dom, array $a, Stub
176197
return $a;
177198
}
178199

200+
/**
201+
* @return array
202+
*/
179203
public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNested)
180204
{
181205
$a += [
@@ -189,6 +213,9 @@ public static function castAttr(\DOMAttr $dom, array $a, Stub $stub, bool $isNes
189213
return $a;
190214
}
191215

216+
/**
217+
* @return array
218+
*/
192219
public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool $isNested)
193220
{
194221
$a += [
@@ -199,6 +226,9 @@ public static function castElement(\DOMElement $dom, array $a, Stub $stub, bool
199226
return $a;
200227
}
201228

229+
/**
230+
* @return array
231+
*/
202232
public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNested)
203233
{
204234
$a += [
@@ -208,6 +238,9 @@ public static function castText(\DOMText $dom, array $a, Stub $stub, bool $isNes
208238
return $a;
209239
}
210240

241+
/**
242+
* @return array
243+
*/
211244
public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $stub, bool $isNested)
212245
{
213246
$a += [
@@ -222,6 +255,9 @@ public static function castDocumentType(\DOMDocumentType $dom, array $a, Stub $s
222255
return $a;
223256
}
224257

258+
/**
259+
* @return array
260+
*/
225261
public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, bool $isNested)
226262
{
227263
$a += [
@@ -232,6 +268,9 @@ public static function castNotation(\DOMNotation $dom, array $a, Stub $stub, boo
232268
return $a;
233269
}
234270

271+
/**
272+
* @return array
273+
*/
235274
public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $isNested)
236275
{
237276
$a += [
@@ -246,6 +285,9 @@ public static function castEntity(\DOMEntity $dom, array $a, Stub $stub, bool $i
246285
return $a;
247286
}
248287

288+
/**
289+
* @return array
290+
*/
249291
public static function castProcessingInstruction(\DOMProcessingInstruction $dom, array $a, Stub $stub, bool $isNested)
250292
{
251293
$a += [
@@ -256,6 +298,9 @@ public static function castProcessingInstruction(\DOMProcessingInstruction $dom,
256298
return $a;
257299
}
258300

301+
/**
302+
* @return array
303+
*/
259304
public static function castXPath(\DOMXPath $dom, array $a, Stub $stub, bool $isNested)
260305
{
261306
$a += [

Caster/DateCaster.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ class DateCaster
2424
{
2525
private const PERIOD_LIMIT = 3;
2626

27+
/**
28+
* @return array
29+
*/
2730
public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub, bool $isNested, int $filter)
2831
{
2932
$prefix = Caster::PREFIX_VIRTUAL;
@@ -47,6 +50,9 @@ public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub,
4750
return $a;
4851
}
4952

53+
/**
54+
* @return array
55+
*/
5056
public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter)
5157
{
5258
$now = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
@@ -76,6 +82,9 @@ private static function formatInterval(\DateInterval $i): string
7682
return $i->format(rtrim($format));
7783
}
7884

85+
/**
86+
* @return array
87+
*/
7988
public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stub, bool $isNested, int $filter)
8089
{
8190
$location = $timeZone->getLocation();
@@ -87,6 +96,9 @@ public static function castTimeZone(\DateTimeZone $timeZone, array $a, Stub $stu
8796
return $filter & Caster::EXCLUDE_VERBOSE ? $z : $z + $a;
8897
}
8998

99+
/**
100+
* @return array
101+
*/
90102
public static function castPeriod(\DatePeriod $p, array $a, Stub $stub, bool $isNested, int $filter)
91103
{
92104
$dates = [];

Caster/DoctrineCaster.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
*/
2626
class DoctrineCaster
2727
{
28+
/**
29+
* @return array
30+
*/
2831
public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub, bool $isNested)
2932
{
3033
foreach (['__cloner__', '__initializer__'] as $k) {
@@ -37,6 +40,9 @@ public static function castCommonProxy(CommonProxy $proxy, array $a, Stub $stub,
3740
return $a;
3841
}
3942

43+
/**
44+
* @return array
45+
*/
4046
public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool $isNested)
4147
{
4248
foreach (['_entityPersister', '_identifier'] as $k) {
@@ -49,6 +55,9 @@ public static function castOrmProxy(OrmProxy $proxy, array $a, Stub $stub, bool
4955
return $a;
5056
}
5157

58+
/**
59+
* @return array
60+
*/
5261
public static function castPersistentCollection(PersistentCollection $coll, array $a, Stub $stub, bool $isNested)
5362
{
5463
foreach (['snapshot', 'association', 'typeClass'] as $k) {

Caster/ExceptionCaster.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,25 @@ class ExceptionCaster
4646

4747
private static array $framesCache = [];
4848

49+
/**
50+
* @return array
51+
*/
4952
public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
5053
{
5154
return self::filterExceptionArray($stub->class, $a, "\0Error\0", $filter);
5255
}
5356

57+
/**
58+
* @return array
59+
*/
5460
public static function castException(\Exception $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
5561
{
5662
return self::filterExceptionArray($stub->class, $a, "\0Exception\0", $filter);
5763
}
5864

65+
/**
66+
* @return array
67+
*/
5968
public static function castErrorException(\ErrorException $e, array $a, Stub $stub, bool $isNested)
6069
{
6170
if (isset($a[$s = Caster::PREFIX_PROTECTED.'severity'], self::$errorTypes[$a[$s]])) {
@@ -65,6 +74,9 @@ public static function castErrorException(\ErrorException $e, array $a, Stub $st
6574
return $a;
6675
}
6776

77+
/**
78+
* @return array
79+
*/
6880
public static function castThrowingCasterException(ThrowingCasterException $e, array $a, Stub $stub, bool $isNested)
6981
{
7082
$trace = Caster::PREFIX_VIRTUAL.'trace';
@@ -83,6 +95,9 @@ public static function castThrowingCasterException(ThrowingCasterException $e, a
8395
return $a;
8496
}
8597

98+
/**
99+
* @return array
100+
*/
86101
public static function castSilencedErrorContext(SilencedErrorContext $e, array $a, Stub $stub, bool $isNested)
87102
{
88103
$sPrefix = "\0".SilencedErrorContext::class."\0";
@@ -110,6 +125,9 @@ public static function castSilencedErrorContext(SilencedErrorContext $e, array $
110125
return $a;
111126
}
112127

128+
/**
129+
* @return array
130+
*/
113131
public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, bool $isNested)
114132
{
115133
if (!$isNested) {
@@ -184,6 +202,9 @@ public static function castTraceStub(TraceStub $trace, array $a, Stub $stub, boo
184202
return $a;
185203
}
186204

205+
/**
206+
* @return array
207+
*/
187208
public static function castFrameStub(FrameStub $frame, array $a, Stub $stub, bool $isNested)
188209
{
189210
if (!$isNested) {

Caster/FiberCaster.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
*/
2121
final class FiberCaster
2222
{
23+
/**
24+
* @return array
25+
*/
2326
public static function castFiber(\Fiber $fiber, array $a, Stub $stub, bool $isNested, int $filter = 0)
2427
{
2528
$prefix = Caster::PREFIX_VIRTUAL;

Caster/IntlCaster.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
*/
2222
class IntlCaster
2323
{
24+
/**
25+
* @return array
26+
*/
2427
public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub $stub, bool $isNested)
2528
{
2629
$a += [
@@ -31,6 +34,9 @@ public static function castMessageFormatter(\MessageFormatter $c, array $a, Stub
3134
return self::castError($c, $a);
3235
}
3336

37+
/**
38+
* @return array
39+
*/
3440
public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
3541
{
3642
$a += [
@@ -108,6 +114,9 @@ public static function castNumberFormatter(\NumberFormatter $c, array $a, Stub $
108114
return self::castError($c, $a);
109115
}
110116

117+
/**
118+
* @return array
119+
*/
111120
public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub, bool $isNested)
112121
{
113122
$a += [
@@ -125,6 +134,9 @@ public static function castIntlTimeZone(\IntlTimeZone $c, array $a, Stub $stub,
125134
return self::castError($c, $a);
126135
}
127136

137+
/**
138+
* @return array
139+
*/
128140
public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
129141
{
130142
$a += [
@@ -142,6 +154,9 @@ public static function castIntlCalendar(\IntlCalendar $c, array $a, Stub $stub,
142154
return self::castError($c, $a);
143155
}
144156

157+
/**
158+
* @return array
159+
*/
145160
public static function castIntlDateFormatter(\IntlDateFormatter $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
146161
{
147162
$a += [

0 commit comments

Comments
 (0)