| 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('scope')) { |
||
| 28 | $scope = $commandParameters->get('scope'); |
||
| 29 | if (!is_string($scope)) { |
||
| 30 | throw new \InvalidArgumentException('The "scope" parameter must be a string.'); |
||
| 31 | } |
||
| 32 | if (1 !== preg_match('/^[\x20\x23-\x5B\x5D-\x7E]+$/', $scope)) { |
||
| 33 | throw new \InvalidArgumentException('Invalid characters found in the "scope" parameter.'); |
||
| 34 | } |
||
| 35 | $validatedParameters = $validatedParameters->with('scope', $scope); |
||
| 36 | } |
||
| 37 | |||
| 38 | return $next($clientId, $commandParameters, $validatedParameters); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |