| Conditions | 5 |
| Paths | 10 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function getParams(string $providerName, ?AccessUrl $url = null): array |
||
| 21 | { |
||
| 22 | $urlId = $url ? $url->getId() : $this->urlHelper->getCurrent()->getId(); |
||
| 23 | |||
| 24 | $authentication = $this->parameterBag->get('authentication'); |
||
| 25 | |||
| 26 | if (isset($authentication[$urlId])) { |
||
| 27 | $urlParams = $authentication[$urlId]; |
||
| 28 | } elseif (isset($authentication['default'])) { |
||
| 29 | $urlParams = $authentication['default']; |
||
| 30 | } else { |
||
| 31 | throw new InvalidArgumentException('Invalid access URL configuration'); |
||
| 32 | } |
||
| 33 | |||
| 34 | if (!isset($urlParams[$providerName])) { |
||
| 35 | throw new InvalidArgumentException('Invalid authentication provider for access URL'); |
||
| 36 | } |
||
| 37 | |||
| 38 | return $urlParams[$providerName]; |
||
| 39 | } |
||
| 48 |