Skip to content

Commit 3e6b1d8

Browse files
committed
Refine types after CI v4.7.4 fixes
1 parent 0809c89 commit 3e6b1d8

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎tests/data/type-inference/request-accessors.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ function test_get_server(IncomingRequest $request, string $name): void
4040
function test_get_json(IncomingRequest $request, bool $assoc): void
4141
{
4242
// A constant true decodes objects as associative arrays, so stdClass is dropped.
43-
assertType('array|bool|float|int|null', $request->getJSON(true));
43+
assertType('array<int|string, mixed>|bool|float|int|null', $request->getJSON(true));
4444

4545
// A false, absent, or non-constant $assoc leaves the declared union.
46-
assertType('array|bool|float|int|stdClass|null', $request->getJSON());
47-
assertType('array|bool|float|int|stdClass|null', $request->getJSON(false));
48-
assertType('array|bool|float|int|stdClass|null', $request->getJSON($assoc));
46+
assertType('array<int|string, mixed>|bool|float|int|stdClass|null', $request->getJSON());
47+
assertType('array<int|string, mixed>|bool|float|int|stdClass|null', $request->getJSON(false));
48+
assertType('array<int|string, mixed>|bool|float|int|stdClass|null', $request->getJSON($assoc));
4949
}

‎tests/data/type-inference/request-var-accessors.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ function test_incoming_request(IncomingRequest $request, string $key, array $key
4444
assertType('array<mixed>|string|null', $request->getGetPost('id'));
4545

4646
// getRawInputVar's string leaf is left as the declared union.
47-
assertType('array|bool|float|int|object|string|null', $request->getRawInputVar('field'));
47+
assertType('mixed', $request->getRawInputVar('field'));
4848

4949
// A filter argument re-types the value, so the declared union is left in place.
50-
assertType('array|bool|float|int|object|string|null', $request->getGet('q', FILTER_VALIDATE_INT));
50+
assertType('mixed', $request->getGet('q', FILTER_VALIDATE_INT));
5151

5252
// An ambiguous index (string or null) cannot be resolved.
53-
assertType('array|bool|float|int|object|string|null', $request->getGet($maybe));
53+
assertType('mixed', $request->getGet($maybe));
5454
}
5555

5656
/**

0 commit comments

Comments
 (0)