| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2.0185 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 114 | public function __construct($routeResult, UrlTemplate $urlTemplate = null) { |
|
| 28 | 114 | if (!is_string($routeResult)) { |
|
| 29 | throw new \InvalidArgumentException('Invalid result type. Expect string. Given "' . gettype($routeResult) . '"'); |
||
| 30 | } |
||
| 31 | |||
| 32 | 114 | $this->result = $routeResult; |
|
| 33 | 114 | parent::__construct($urlTemplate); |
|
| 34 | 114 | } |
|
| 35 | |||
| 67 | } |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.