| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 43 | 36 | public function doMatch(RequestContext $requestContext) { |
|
| 44 | 36 | if (empty($this->getRoutes())) { |
|
| 45 | 3 | throw new \Exception('Routes list can\'t be empty!'); |
|
| 46 | } |
||
| 47 | |||
| 48 | 33 | if (false == $this->isMatched($requestContext)) { |
|
|
|
|||
| 49 | 6 | return false; |
|
| 50 | } |
||
| 51 | |||
| 52 | 27 | foreach ($this->getRoutes() as $route) { |
|
| 53 | 27 | $routeMatch = $route->doMatch($requestContext); |
|
| 54 | 27 | if ($routeMatch instanceof RouteMatch) { |
|
| 55 | 21 | $routeMatch = $this->storeParametersToRouteMatch($routeMatch); |
|
| 56 | 21 | return $routeMatch; |
|
| 57 | } |
||
| 58 | 12 | } |
|
| 59 | 6 | return false; |
|
| 60 | } |
||
| 61 | |||
| 62 | } |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.