Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
37 | 2 | $url = 'tv/' . $this->tv_id . '/season/' . $this->season_number; |
|
38 | 2 | $key = 'posters'; |
|
39 | 2 | if (isset($this->episode_number)) { |
|
40 | 1 | $url .= '/episode/' . $this->episode_number; |
|
41 | 1 | $key = 'stills'; |
|
42 | } |
||
43 | 2 | $url .= '/images'; |
|
44 | |||
45 | 2 | $params = new \stdClass; |
|
46 | 2 | $params->url = $url; |
|
68 |
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: