1 | <?php |
||
22 | class MomentPresenter extends AbstractPresenter |
||
23 | { |
||
24 | use TimestampsTrait; |
||
25 | |||
26 | /** |
||
27 | * Renders the message from Markdown into HTML. |
||
28 | * |
||
29 | * @return string |
||
30 | */ |
||
31 | public function formattedData() |
||
35 | |||
36 | |||
37 | public function formattedTarget() |
||
45 | |||
46 | /** |
||
47 | * Get the moment action summary |
||
48 | * |
||
49 | * @return string |
||
50 | */ |
||
51 | protected function actionName() |
||
52 | { |
||
53 | switch ($this->wrappedObject->action) { |
||
54 | case Moment::CREATED: |
||
55 | return 'created'; |
||
56 | case Moment::CLOSED: |
||
57 | return 'closed'; |
||
58 | case Moment::COMMENTED: |
||
59 | return 'commented on'; |
||
60 | default: |
||
61 | return 'Unknow'; |
||
62 | } |
||
63 | } |
||
64 | |||
65 | public function icon() |
||
75 | /** |
||
76 | * Present formatted date time. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public function created_at_iso() |
||
84 | |||
85 | /** |
||
86 | * Convert presented moment to an array. |
||
87 | * |
||
88 | * @return array |
||
89 | */ |
||
90 | public function toArray() |
||
97 | } |
||
98 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.