Conditions | 5 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function resolve(RequestContext $requestContext): SiteInterface |
||
27 | { |
||
28 | $identifier = $this->identifierMapping->findIdentifierByHostname($requestContext->getHost()); |
||
29 | |||
30 | if (null === $identifier) { |
||
31 | throw SiteNotFoundException::withRequestContext($requestContext); |
||
32 | } |
||
33 | |||
34 | foreach ($this->siteRepository->findAll() as $site) { |
||
35 | if ($site instanceof IdentifiedSiteInterface && $site->matches($identifier)) { |
||
36 | return $site; |
||
37 | } |
||
38 | } |
||
39 | |||
40 | throw SiteNotFoundException::withRequestContext($requestContext); |
||
41 | } |
||
43 |