| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 49 | public function getCurrentPageWithForm(array $pages) |
||
| 50 | { |
||
| 51 | $routeParameters = $this->urlMatcher->match(parse_url($this->session->getCurrentUrl(), PHP_URL_PATH)); |
||
| 52 | |||
| 53 | Assert::allIsInstanceOf($pages, SymfonyPageInterface::class); |
||
| 54 | |||
| 55 | foreach ($pages as $page) { |
||
| 56 | if ($routeParameters['_route'] === $page->getRouteName()) { |
||
| 57 | return $page; |
||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 61 | throw new \LogicException('Route name could not be matched to provided pages.'); |
||
| 62 | } |
||
| 63 | } |
||
| 64 |