1 | <?php |
||
25 | class MessageService implements SingletonInterface |
||
26 | { |
||
27 | use ExtendedSelfInstantiateTrait; |
||
28 | |||
29 | /** |
||
30 | * @var Dispatcher |
||
31 | */ |
||
32 | protected $signalSlotDispatcher; |
||
33 | |||
34 | /** |
||
35 | * @param Message $message |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getMessageValidationName(Message $message) |
||
44 | |||
45 | /** |
||
46 | * @param Message $message |
||
47 | * @return string |
||
48 | */ |
||
49 | public function getMessageKey(Message $message) |
||
55 | |||
56 | /** |
||
57 | * This function will go through all errors, warnings and notices and check |
||
58 | * if they are instances of `FormzMessageInterface`. If not, they are |
||
59 | * converted in order to have more informations that are needed later. |
||
60 | * |
||
61 | * @param Result $result |
||
62 | * @param string $validationName |
||
63 | * @return Result |
||
64 | */ |
||
65 | public function sanitizeValidatorResult(Result $result, $validationName) |
||
75 | |||
76 | /** |
||
77 | * @param string $type |
||
78 | * @param array $messages |
||
79 | * @param Result $newResult |
||
80 | * @param string $validationName |
||
81 | */ |
||
82 | protected function sanitizeValidatorResultMessages($type, array $messages, Result $newResult, $validationName) |
||
110 | |||
111 | /** |
||
112 | * @param array $message |
||
113 | * @param array $arguments |
||
114 | * @return string |
||
115 | */ |
||
116 | public function parseMessageArray(array $message, array $arguments) |
||
130 | |||
131 | /** |
||
132 | * Will return an array by considering the supported messages, and filling |
||
133 | * the supported ones with the given values. |
||
134 | * |
||
135 | * @param FormzMessage[] $messages |
||
136 | * @param array $supportedMessages |
||
137 | * @param bool $canCreateNewMessages |
||
138 | * @return array |
||
139 | */ |
||
140 | public function filterMessages(array $messages, array $supportedMessages, $canCreateNewMessages = false) |
||
178 | |||
179 | /** |
||
180 | * @param Dispatcher $signalSlotDispatcher |
||
181 | */ |
||
182 | public function injectSignalSlotDispatcher(Dispatcher $signalSlotDispatcher) |
||
186 | } |
||
187 |