| Conditions | 8 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | protected function determineTargetUrl(Request $request) |
||
| 26 | { |
||
| 27 | if ($this->options['always_use_default_target_path']) { |
||
| 28 | return $this->options['default_target_path']; |
||
| 29 | } |
||
| 30 | |||
| 31 | if ($targetUrl = ParameterBagUtils::getRequestParameterValue($request, $this->options['target_path_parameter'])) { |
||
| 32 | return $targetUrl; |
||
| 33 | } |
||
| 34 | |||
| 35 | if (null !== $this->providerKey && $targetUrl = $this->getTargetPath($request->getSession(), $this->providerKey)) { |
||
| 36 | $this->removeTargetPath($request->getSession(), $this->providerKey); |
||
| 37 | |||
| 38 | return $targetUrl; |
||
| 39 | } |
||
| 40 | |||
| 41 | if ($this->options['use_referer'] && ($targetUrl = $request->headers->get('Referer')) && parse_url($targetUrl, PHP_URL_PATH) !== parse_url($this->httpUtils->generateUri($request, $this->options['login_path']), PHP_URL_PATH)) { |
||
| 42 | return $targetUrl; |
||
| 43 | } |
||
| 44 | |||
| 45 | return $this->options['default_target_path']; |
||
| 46 | } |
||
| 47 | } |
||
| 48 |