Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
25 | public function handle(ClientId $clientId, DataBag $commandParameters, DataBag $validatedParameters, callable $next): DataBag |
||
26 | { |
||
27 | if ($commandParameters->has('default_scope')) { |
||
28 | $defaultScope = $commandParameters->get('default_scope'); |
||
29 | if (!is_string($defaultScope)) { |
||
30 | throw new \InvalidArgumentException('The "default_scope" parameter must be a string.'); |
||
31 | } |
||
32 | if (1 !== preg_match('/^[\x20\x23-\x5B\x5D-\x7E]+$/', $defaultScope)) { |
||
33 | throw new \InvalidArgumentException('Invalid characters found in the "default_scope" parameter.'); |
||
34 | } |
||
35 | $validatedParameters = $validatedParameters->with('default_scope', $commandParameters->get('default_scope')); |
||
36 | } |
||
37 | |||
38 | return $next($clientId, $commandParameters, $validatedParameters); |
||
39 | } |
||
40 | } |
||
41 |