| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 18 | public function __construct(Tmdb $tmdb, $id, \stdClass $result) |
|
| 20 | { |
||
| 21 | 18 | parent::__construct($tmdb, $result); |
|
| 22 | |||
| 23 | 17 | $this->id = (int) $id; |
|
|
|
|||
| 24 | 17 | $this->aspect_ratio = $result->aspect_ratio; |
|
| 25 | 17 | $this->file_path = $result->file_path; |
|
| 26 | 17 | $this->height = $result->height; |
|
| 27 | 17 | $this->iso_639_1 = $result->iso_639_1; |
|
| 28 | 17 | $this->vote_average = $result->vote_average; |
|
| 29 | 17 | $this->vote_count = $result->vote_count; |
|
| 30 | 17 | $this->width = $result->width; |
|
| 31 | 17 | } |
|
| 32 | |||
| 74 |
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: