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