1 | <?php |
||
5 | abstract class IMAPMessageContent implements IMAPMessagePartInterface { |
||
6 | |||
7 | /** @var object */ |
||
8 | protected $structure; |
||
9 | |||
10 | /** @var IMAPMessagePart[] */ |
||
11 | protected $parts = []; |
||
12 | |||
13 | /** @var array */ |
||
14 | protected $parameters = []; |
||
15 | |||
16 | /** @return IMAPMessagePartInterface[] */ |
||
17 | abstract public function parts(); |
||
18 | |||
19 | /** @return IMAPMessagePartInterface[] */ |
||
20 | public function allParts() { |
||
35 | |||
36 | /** @return IMAPMessagePartInterface */ |
||
37 | public function part( $index ) { |
||
41 | |||
42 | /** @return array */ |
||
43 | public function parameters() { |
||
59 | |||
60 | /** @return mixed */ |
||
61 | public function parameter( $name ) { |
||
66 | |||
67 | /** @return string[] */ |
||
68 | public function headers() { |
||
82 | |||
83 | /** @return string|string[] */ |
||
84 | public function header( $name ) { |
||
89 | |||
90 | /** @return IMAPMessagePartInterface[] */ |
||
91 | public function subtypeParts( $subtypes, $recursive ) { |
||
101 | |||
102 | /** @return IMAPMessagePartInterface */ |
||
103 | public function subtypePart( $subtypes, $recursive ) { |
||
108 | |||
109 | /** @return string */ |
||
110 | public function subtypeContent( $subtypes, $recursive ) { |
||
117 | |||
118 | /** @return string */ |
||
119 | public function text( $recursive = false ) { |
||
122 | |||
123 | /** @return string */ |
||
124 | public function html( $recursive = false ) { |
||
127 | |||
128 | } |
||
129 |
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: