1 | <?php |
||
14 | abstract class Messages { |
||
15 | |||
16 | protected static $view = 'Blocks/Utils/Message'; |
||
17 | |||
18 | protected static $types = ['info', 'warning', 'error', 'success']; |
||
19 | |||
20 | protected static $items = []; |
||
21 | |||
22 | /** |
||
23 | * Initialize the messages list |
||
24 | */ |
||
25 | |||
26 | public static function init() { |
||
30 | |||
31 | /** |
||
32 | * Set a message |
||
33 | */ |
||
34 | |||
35 | public static function set(string $type, string $text, string $title = null) { |
||
41 | |||
42 | /** |
||
43 | * Get a message |
||
44 | * |
||
45 | * @return array|false : the message data or false if the message was not set |
||
46 | */ |
||
47 | |||
48 | public static function get(string $type) { |
||
52 | |||
53 | /** |
||
54 | * Get a messages block |
||
55 | */ |
||
56 | |||
57 | public static function getBlock() : Template\Block { |
||
74 | } |
||
75 | } |
||
76 |
Since your code implements the magic setter
_set
, this function will be called for any write access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.Since the property has write access only, you can use the @property-write 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.