| Conditions | 5 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 37 | public function __construct(Tmdb $tmdb, \stdClass $result) |
|
| 21 | { |
||
| 22 | // Valid input object |
||
| 23 | 37 | $properties = get_object_vars($this); |
|
| 24 | 37 | foreach (array_keys($properties) as $property) |
|
| 25 | { |
||
| 26 | 37 | if ($property != 'conf' && $property != 'data' && !property_exists($result, $property)) |
|
| 27 | { |
||
| 28 | 37 | throw new \Exception('Incorrect input for ' . __CLASS__ . ' object. Property "' . $property . '" not found'); |
|
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | // Configuration |
||
| 33 | 37 | $this->conf = $tmdb->getConfiguration(); |
|
| 34 | 37 | $this->data = $result; |
|
| 35 | 37 | } |
|
| 36 | |||
| 38 |