public static function castRequest(Request $request, array $a, Stub $stub, bool $isNested) : array { $clone = null; foreach (self::REQUEST_GETTERS as $prop => $getter) { $key = Caster::PREFIX_PROTECTED . $prop; if (\array_key_exists($key, $a) && null === $a[$key]) { $clone ??= clone $request; $a[Caster::PREFIX_VIRTUAL . $prop] = $clone->{$getter}(); } } return $a; }