| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 5 | public function __construct(Tmdb $tmdb, \stdClass $result) |
|
| 23 | { |
||
| 24 | 5 | parent::__construct($tmdb, $result); |
|
| 25 | |||
| 26 | // Populate data |
||
| 27 | 5 | $this->id = $this->data->id; |
|
| 28 | 5 | $this->release_date = $this->data->air_date; |
|
|
|
|||
| 29 | 5 | $this->episode_count = $this->data->episode_count; |
|
| 30 | 5 | $this->poster_path = $this->data->poster_path; |
|
| 31 | 5 | $this->season_number = $this->data->season_number; |
|
| 32 | 5 | } |
|
| 33 | |||
| 54 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: