1 | <?php |
||
9 | class Release |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | public $id; |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | public $title; |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | public $status; |
||
23 | /** |
||
24 | * @var string |
||
25 | */ |
||
26 | public $quality; |
||
27 | /** |
||
28 | * @var string |
||
29 | */ |
||
30 | public $language; |
||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | public $script; |
||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | public $date; |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | public $country; |
||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | public $barcode; |
||
47 | /** |
||
48 | * @var Artist[] |
||
49 | */ |
||
50 | public $artists = array(); |
||
51 | /** |
||
52 | * @var |
||
53 | */ |
||
54 | protected $releaseDate; |
||
55 | /** |
||
56 | * @var array |
||
57 | */ |
||
58 | private $data; |
||
59 | |||
60 | /** |
||
61 | * @param array $release |
||
62 | * @param MusicBrainz $brainz |
||
63 | */ |
||
64 | public function __construct(array $release, MusicBrainz $brainz) |
||
79 | |||
80 | /** |
||
81 | * @return string |
||
82 | */ |
||
83 | public function getId() |
||
87 | |||
88 | /** |
||
89 | * Get's the earliest release date |
||
90 | * @return \DateTime |
||
91 | */ |
||
92 | public function getReleaseDate() |
||
107 | |||
108 | /** |
||
109 | * @param array $releaseEvents |
||
110 | * |
||
111 | * @return \DateTime |
||
112 | */ |
||
113 | public function getReleaseEventDates(array $releaseEvents) |
||
130 | } |
||
131 |
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: