Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
35 | 2 | protected function getPostersParams() : \stdClass |
|
36 | { |
||
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; |
|
47 | 2 | $params->key = $key; |
|
48 | |||
49 | 2 | return $params; |
|
50 | } |
||
51 | |||
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: