1 | <?php |
||
31 | class PostponeRuntimeBackend extends RuntimeBackend |
||
32 | { |
||
33 | /** |
||
34 | * @var MessageInterface[] |
||
35 | */ |
||
36 | protected $messages = []; |
||
37 | |||
38 | /** |
||
39 | * If set to true, you have to fire an event the onEvent method is subscribed to manually! |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | protected $postponeOnCli = false; |
||
44 | |||
45 | /** |
||
46 | * @param bool $postponeOnCli Whether to postpone the messages on the CLI, too |
||
47 | */ |
||
48 | public function __construct(EventDispatcherInterface $dispatcher, $postponeOnCli = false) |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function publish(MessageInterface $message): void |
||
70 | |||
71 | /** |
||
72 | * Listen on any event and handle the messages. |
||
73 | * |
||
74 | * Actually, an event is not necessary, you can call this method manually, to. |
||
75 | * The event is not processed in any way. |
||
76 | */ |
||
77 | public function onEvent(?Event $event = null): void |
||
85 | |||
86 | /** |
||
87 | * {@inheritdoc} |
||
88 | */ |
||
89 | public function getIterator() |
||
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | public function getStatus() |
||
101 | |||
102 | /** |
||
103 | * Check whether this Backend is run on the CLI. |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | protected function isCommandLineInterface() |
||
111 | } |
||
112 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.