1 | <?php |
||
24 | class MessageService implements SingletonInterface |
||
25 | { |
||
26 | use ExtendedFacadeInstanceTrait; |
||
27 | |||
28 | /** |
||
29 | * @var Dispatcher |
||
30 | */ |
||
31 | protected $signalSlotDispatcher; |
||
32 | |||
33 | /** |
||
34 | * Returns the validation name of a message: if it is an instance of |
||
35 | * `FormzMessageInterface`, we can fetch it, otherwise `unknown` is |
||
36 | * returned. |
||
37 | * |
||
38 | * @param Message $message |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getMessageValidationName(Message $message) |
||
47 | |||
48 | /** |
||
49 | * Returns the key of a message: if it is an instance of |
||
50 | * `FormzMessageInterface`, we can fetch it, otherwise `unknown` is |
||
51 | * returned. |
||
52 | * |
||
53 | * @param Message $message |
||
54 | * @return string |
||
55 | */ |
||
56 | public function getMessageKey(Message $message) |
||
62 | |||
63 | /** |
||
64 | * @param array $message |
||
65 | * @param array $arguments |
||
66 | * @return string |
||
67 | */ |
||
68 | public function parseMessageArray(array $message, array $arguments) |
||
82 | |||
83 | /** |
||
84 | * Will return an array by considering the supported messages, and filling |
||
85 | * the supported ones with the given values. |
||
86 | * |
||
87 | * @param FormzMessage[] $messages |
||
88 | * @param array $supportedMessages |
||
89 | * @param bool $canCreateNewMessages |
||
90 | * @return array |
||
91 | */ |
||
92 | public function filterMessages(array $messages, array $supportedMessages, $canCreateNewMessages = false) |
||
130 | |||
131 | /** |
||
132 | * @param Dispatcher $signalSlotDispatcher |
||
133 | */ |
||
134 | public function injectSignalSlotDispatcher(Dispatcher $signalSlotDispatcher) |
||
138 | } |
||
139 |