Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public function handle(DataBag $commandParameters, DataBag $validatedParameters, ? UserAccountId $userAccountId, callable $next): DataBag |
||
25 | { |
||
26 | if (!$commandParameters->has('client_id')) { |
||
27 | throw new \InvalidArgumentException('Client ID not defined.'); |
||
28 | } |
||
29 | $validatedParameters = $validatedParameters->with('client_id', $commandParameters->get('client_id')); |
||
30 | |||
31 | if ($commandParameters->has('client_id_issued_at')) { |
||
32 | $validatedParameters = $validatedParameters->with('client_id_issued_at', $commandParameters->get('client_id_issued_at')); |
||
33 | } else { |
||
34 | $validatedParameters = $validatedParameters->with('client_id_issued_at', time()); |
||
35 | } |
||
36 | |||
37 | return $next($commandParameters, $validatedParameters, $userAccountId); |
||
38 | } |
||
39 | |||
41 |