2222use stdClass ;
2323use UnitEnum ;
2424
25+ use function array_map ;
26+ use function count ;
27+ use function implode ;
28+ use function in_array ;
29+ use function is_a ;
30+ use function is_string ;
31+ use function preg_match ;
32+ use function preg_match_all ;
33+ use function preg_replace ;
34+ use function sprintf ;
35+ use function strtolower ;
36+
37+ use const PREG_SET_ORDER ;
38+
2539/**
2640 * @internal This class is not part of the public API, and may change without notice.
2741 */
@@ -50,13 +64,6 @@ final class Reflector
5064 'callable ' ,
5165 ];
5266
53- public function __construct (
54- public readonly bool $ allowUntypedArrays = false ,
55- public readonly bool $ allowUntypedObjects = false ,
56- public readonly bool $ allowMixed = false ,
57- ) {
58- }
59-
6067 /**
6168 * Cache of parameter types, indexed by cache key.
6269 *
@@ -67,6 +74,13 @@ public function __construct(
6774 */
6875 private array $ parameterTypes = [];
6976
77+ public function __construct (
78+ public readonly bool $ allowUntypedArrays = false ,
79+ public readonly bool $ allowUntypedObjects = false ,
80+ public readonly bool $ allowMixed = false ,
81+ ) {
82+ }
83+
7084 /**
7185 * @throws JsonMapperException
7286 */
@@ -321,7 +335,7 @@ private function convertNamedType(string $namedType, bool $isReflection, Reflect
321335 'Parameter %s contains type "mixed" which is not allowed by default. ' ,
322336 $ this ->getParameterNameWithDeclaringFunctionName ($ reflectionParameter ),
323337 ),
324- 'If you want to allow this, and receive the raw JSON value, set $allowMixed to true. '
338+ 'If you want to allow this, and receive the raw JSON value, set $allowMixed to true. ' ,
325339 ]);
326340 }
327341
0 commit comments