| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function handle(ClientId $clientId, DataBag $commandParameters, DataBag $validatedParameters, callable $next): DataBag |
||
| 40 | { |
||
| 41 | if ($commandParameters->has('scope')) { |
||
| 42 | $defaultScope = $commandParameters->get('scope'); |
||
| 43 | if (!is_string($defaultScope)) { |
||
| 44 | throw new \InvalidArgumentException('The parameter "scope" must be a string.'); |
||
| 45 | } |
||
| 46 | if (1 !== preg_match('/^[\x20\x23-\x5B\x5D-\x7E]+$/', $defaultScope)) { |
||
| 47 | throw new \InvalidArgumentException('Invalid characters found in the "scope" parameter.'); |
||
| 48 | } |
||
| 49 | $validatedParameters = $validatedParameters->with('scope', $commandParameters->get('scope')); |
||
| 50 | } |
||
| 51 | |||
| 52 | return $next($clientId, $commandParameters, $validatedParameters); |
||
| 53 | } |
||
| 54 | } |
||
| 55 |