1 | <?php |
||
15 | class Message { |
||
16 | /** |
||
17 | * Message ID |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | public $id; |
||
22 | |||
23 | /** |
||
24 | * Message content |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $content; |
||
29 | |||
30 | /** |
||
31 | * Call to action |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $cta; |
||
36 | |||
37 | /** |
||
38 | * Class constructor |
||
39 | * |
||
40 | * @param string $id Message ID. |
||
41 | */ |
||
42 | public function __construct( $id ) { |
||
56 | |||
57 | /** |
||
58 | * Renders the internal state to a simple object |
||
59 | * |
||
60 | * @return \stdClass|bool The simple object |
||
61 | */ |
||
62 | public function render() { |
||
72 | |||
73 | /** |
||
74 | * Show the specified message to the user |
||
75 | * |
||
76 | * @param string $message The message. |
||
77 | * @param string $description A longer description that shows up under the message. |
||
78 | * |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function show( $message, $description = '' ) { |
||
87 | |||
88 | /** |
||
89 | * The message path that needs to match before showing |
||
90 | * |
||
91 | * @param string $regex The message path regex. |
||
92 | * |
||
93 | * @return $this |
||
94 | */ |
||
95 | public function message_path( $regex ) { |
||
100 | |||
101 | /** |
||
102 | * A call to action |
||
103 | * |
||
104 | * @param string $cta The message to display on the CTA button. |
||
105 | * @param string $link URL. |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | public function with_cta( $cta, $link = '' ) { |
||
115 | |||
116 | } |
||
117 |
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..