| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 38 | public function getResponse($content) |
|
| 19 | { |
||
| 20 | 38 | $response = $this->parse($content); |
|
| 21 | 33 | $class = 'Thunder\\SimilarWebApi\\Response\\'.$this->name; |
|
| 22 | |||
| 23 | 33 | if(!class_exists($class, true)) |
|
| 24 | 33 | { |
|
| 25 | 1 | throw new \RuntimeException(sprintf('Failed to load response class %s!', $class)); |
|
| 26 | } |
||
| 27 | |||
| 28 | 32 | return new $class($response); |
|
| 29 | } |
||
| 30 | |||
| 33 |