1 | <?php |
||
12 | class Notices { |
||
13 | |||
14 | /** |
||
15 | * The array of notice messages |
||
16 | * |
||
17 | * This is a multidimensional array of |
||
18 | * `array( context => array( 'message' ) );`` |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | private $notices = array(); |
||
23 | |||
24 | /** |
||
25 | * Contains the instantiated Notices instance |
||
26 | * |
||
27 | * @var Path $this->get_instance |
||
28 | */ |
||
29 | private static $instance; |
||
30 | |||
31 | /** |
||
32 | * Protected constructor to prevent creating a new instance of the |
||
33 | * *Singleton* via the `new` operator from outside of this class. |
||
34 | */ |
||
35 | protected function __construct() {} |
||
36 | |||
37 | /** |
||
38 | * Private clone method to prevent cloning of the instance of the |
||
39 | * *Singleton* instance. |
||
40 | */ |
||
41 | private function __clone() {} |
||
42 | |||
43 | /** |
||
44 | * Private unserialize method to prevent unserializing of the *Singleton* |
||
45 | * instance. |
||
46 | */ |
||
47 | private function __wakeup() {} |
||
48 | |||
49 | /** |
||
50 | * Returns the *Singleton* instance of this class. |
||
51 | * |
||
52 | * @staticvar Notices $instance The *Singleton* instances of this class. |
||
53 | * |
||
54 | * @return Notices The *Singleton* instance. |
||
55 | */ |
||
56 | public static function get_instance() { |
||
65 | |||
66 | /** |
||
67 | * Set an array of notice messages for a specific context |
||
68 | * |
||
69 | * @param string $context The context of the notice message |
||
70 | * @param array $messages The array of messages |
||
71 | * @param boolean $persistant Whether the notice should persist via the database. Defaults to true. |
||
72 | */ |
||
73 | public function set_notices( $context, array $messages, $persistant = true ) { |
||
104 | |||
105 | /** |
||
106 | * Fetch an array of notices messages |
||
107 | * |
||
108 | * If you specify a context then you'll just get messages for that context otherwise |
||
109 | * you get multidimensional array of all contexts and their messages. |
||
110 | * |
||
111 | * @param string $context The context that you'd like the messages for |
||
112 | * |
||
113 | * @return array The array of notice messages |
||
114 | */ |
||
115 | public function get_notices( $context = '' ) { |
||
131 | |||
132 | /** |
||
133 | * Get both standard and persistant notices |
||
134 | * |
||
135 | * @return array The array of contexts and notices |
||
136 | */ |
||
137 | private function get_all_notices() { |
||
140 | |||
141 | /** |
||
142 | * Load the persistant notices from the database |
||
143 | * |
||
144 | * @return array The array of notices |
||
145 | */ |
||
146 | private function get_persistant_notices() { |
||
153 | |||
154 | /** |
||
155 | * Clear all notices including persistant ones |
||
156 | */ |
||
157 | public function clear_all_notices() { |
||
161 | } |
||
162 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..