| 1 | <?php |
||
| 19 | class FlashMessage extends Base |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Add success message. |
||
| 23 | * |
||
| 24 | * @param string $message |
||
| 25 | */ |
||
| 26 | public function success($message) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Add failure message. |
||
| 33 | * |
||
| 34 | * @param string $message |
||
| 35 | */ |
||
| 36 | public function failure($message) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Add new flash message. |
||
| 43 | * |
||
| 44 | * @param string $key |
||
| 45 | * @param string $message |
||
| 46 | */ |
||
| 47 | public function setMessage($key, $message) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Get flash message. |
||
| 58 | * |
||
| 59 | * @param string $key |
||
| 60 | * |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | public function getMessage($key) |
||
| 74 | } |
||
| 75 |
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@propertyannotation 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.