1 | <?php |
||
35 | class FlashNotifier extends Nette\Object |
||
36 | { |
||
37 | /** |
||
38 | * @var SessionStorage |
||
39 | */ |
||
40 | protected $sessionStorage; |
||
41 | |||
42 | /** |
||
43 | * @var Localization\ITranslator |
||
44 | */ |
||
45 | protected $translator; |
||
46 | |||
47 | /** |
||
48 | * @param SessionStorage $sessionStorage |
||
49 | * @param Localization\ITranslator $translator |
||
50 | */ |
||
51 | public function __construct(SessionStorage $sessionStorage, Localization\ITranslator $translator = NULL) |
||
56 | |||
57 | /** |
||
58 | * Flash a success message |
||
59 | * |
||
60 | * @param string $message |
||
61 | * @param string|null $title |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | public function success($message, $title = NULL) |
||
71 | |||
72 | /** |
||
73 | * Flash an information message |
||
74 | * |
||
75 | * @param string $message |
||
76 | * @param string|null $title |
||
77 | * |
||
78 | * @return $this |
||
79 | */ |
||
80 | public function info($message, $title = NULL) |
||
86 | |||
87 | /** |
||
88 | * Flash a warning message |
||
89 | * |
||
90 | * @param string $message |
||
91 | * @param string|null $title |
||
92 | * |
||
93 | * @return $this |
||
94 | */ |
||
95 | public function warning($message, $title = NULL) |
||
101 | |||
102 | /** |
||
103 | * Flash an error message |
||
104 | * |
||
105 | * @param string $message |
||
106 | * @param string|null $title |
||
107 | * |
||
108 | * @return $this |
||
109 | */ |
||
110 | public function error($message, $title = NULL) |
||
116 | |||
117 | /** |
||
118 | * Add an "important" flash to the session |
||
119 | * |
||
120 | * @return $this |
||
121 | */ |
||
122 | public function important() |
||
128 | |||
129 | /** |
||
130 | * Flash an overlay modal |
||
131 | * |
||
132 | * @param string $message |
||
133 | * @param string $title |
||
134 | * |
||
135 | * @return $this |
||
136 | */ |
||
137 | public function overlay($message, $title = 'Notice') |
||
143 | |||
144 | /** |
||
145 | * Flash a general message |
||
146 | * |
||
147 | * @param string $message |
||
148 | * @param string $level |
||
149 | * @param string $title |
||
150 | * @param boolean $overlay |
||
151 | * @param int|null $count |
||
152 | * @param array $parameters |
||
153 | * |
||
154 | * @return Entities\IMessage |
||
155 | */ |
||
156 | public function message($message, $level = 'info', $title = 'Notice', $overlay = FALSE, $count = NULL, array $parameters = []) |
||
206 | |||
207 | /** |
||
208 | * @param Entities\IMessage $flash |
||
209 | * @param Entities\IMessage[] $messages |
||
210 | * |
||
211 | * @return bool |
||
212 | */ |
||
213 | private function checkUnique(Entities\IMessage $flash, array $messages) |
||
223 | |||
224 | /** |
||
225 | * @param array $attributes |
||
226 | * @param string $type |
||
227 | * |
||
228 | * @return mixed |
||
229 | */ |
||
230 | private function checkForAttribute(array $attributes, $type) |
||
263 | } |
||
264 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.