@@ -114,10 +114,9 @@ final class SimpleClient
114
114
* ]
115
115
* ]
116
116
*
117
- *
118
117
* @param string|array $config
119
118
*/
120
- public function __construct ($ config , LoggerInterface $ logger = null )
119
+ public function __construct ($ config , ? LoggerInterface $ logger = null )
121
120
{
122
121
if (is_string ($ config )) {
123
122
$ config = [
@@ -134,7 +133,7 @@ public function __construct($config, LoggerInterface $logger = null)
134
133
/**
135
134
* @param callable|Processor $processor
136
135
*/
137
- public function bindTopic (string $ topic , $ processor , string $ processorName = null ): void
136
+ public function bindTopic (string $ topic , $ processor , ? string $ processorName = null ): void
138
137
{
139
138
if (is_callable ($ processor )) {
140
139
$ processor = new CallbackProcessor ($ processor );
@@ -144,7 +143,7 @@ public function bindTopic(string $topic, $processor, string $processorName = nul
144
143
throw new \LogicException ('The processor must be either callable or instance of Processor ' );
145
144
}
146
145
147
- $ processorName = $ processorName ?: uniqid (get_class ( $ processor) );
146
+ $ processorName = $ processorName ?: uniqid ($ processor::class );
148
147
149
148
$ this ->driver ->getRouteCollection ()->add (new Route ($ topic , Route::TOPIC , $ processorName ));
150
149
$ this ->processorRegistry ->add ($ processorName , $ processor );
@@ -153,7 +152,7 @@ public function bindTopic(string $topic, $processor, string $processorName = nul
153
152
/**
154
153
* @param callable|Processor $processor
155
154
*/
156
- public function bindCommand (string $ command , $ processor , string $ processorName = null ): void
155
+ public function bindCommand (string $ command , $ processor , ? string $ processorName = null ): void
157
156
{
158
157
if (is_callable ($ processor )) {
159
158
$ processor = new CallbackProcessor ($ processor );
@@ -163,7 +162,7 @@ public function bindCommand(string $command, $processor, string $processorName =
163
162
throw new \LogicException ('The processor must be either callable or instance of Processor ' );
164
163
}
165
164
166
- $ processorName = $ processorName ?: uniqid (get_class ( $ processor) );
165
+ $ processorName = $ processorName ?: uniqid ($ processor::class );
167
166
168
167
$ this ->driver ->getRouteCollection ()->add (new Route ($ command , Route::COMMAND , $ processorName ));
169
168
$ this ->processorRegistry ->add ($ processorName , $ processor );
@@ -185,7 +184,7 @@ public function sendEvent(string $topic, $message): void
185
184
$ this ->producer ->sendEvent ($ topic , $ message );
186
185
}
187
186
188
- public function consume (ExtensionInterface $ runtimeExtension = null ): void
187
+ public function consume (? ExtensionInterface $ runtimeExtension = null ): void
189
188
{
190
189
$ this ->setupBroker ();
191
190
0 commit comments