Lines
100.00%
25 / 25
Methods
100.00%
3 / 3
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| getScopes | 100.00% | 11 / 11 | 100.00% | 1 / 1 | 5 | ||
| getClusters | 100.00% | 11 / 11 | 100.00% | 1 / 1 | 5 | ||
| getFromOldMehrfachKiosk | 100.00% | 3 / 3 | 100.00% | 1 / 1 | 1 | ||
| 14 | class EntryFromOldRoute | |
| 15 | { | |
| 16 | protected static function getScopes($request): string|null | |
| 17 | { | |
| 18 | $scopes = [ ]; | |
| 19 | $validator = $request->getAttribute('validator'); | |
| 20 | $scopeData = $validator->getParameter('auswahlstandortid') | |
| 21 | ->isArray() | |
| 22 | ->getValue(); | |
| 23 | if ($scopeData) { | |
| 24 | foreach ($scopeData as $scope) { | |
| 25 | $scope = Validator::value($scope)->isNumber(); | |
| 26 | if (! $scope->hasFailed()) { | |
| 27 | $scopes[] = 's' . $scope->getValue(); | |
| 28 | } | |
| 29 | } | |
| 30 | } | |
| 31 | return (0 < count($scopes)) ? implode(',', $scopes) : null; | |
| 32 | } | |
| 33 | ||
| 34 | protected static function getClusters($request): string|null | |
| 35 | { | |
| 36 | $clusters = [ ]; | |
| 37 | $validator = $request->getAttribute('validator'); | |
| 38 | $clusterData = $validator->getParameter('auswahlclusterid') | |
| 39 | ->isArray() | |
| 40 | ->getValue(); | |
| 41 | if ($clusterData) { | |
| 42 | foreach ($clusterData as $cluster) { | |
| 43 | $cluster = Validator::value($cluster)->isNumber(); | |
| 44 | if (! $cluster->hasFailed()) { | |
| 45 | $clusters[] = 'c' . $cluster->getValue(); | |
| 46 | } | |
| 47 | } | |
| 48 | } | |
| 49 | return (0 < count($clusters)) ? implode(',', $clusters) : null; | |
| 50 | } | |
| 51 | ||
| 52 | public static function getFromOldMehrfachKiosk(\Psr\Http\Message\RequestInterface $request): string | |
| 53 | { | |
| 54 | $scopes = self::getScopes($request); | |
| 55 | $clusters = self::getClusters($request); | |
| 56 | ||
| 57 | return implode(',', array_filter(array($scopes, $clusters))); | |
| 58 | } | |
| 59 | } |