File tree 3 files changed +16
-3
lines changed
src/Symfony/Component/Messenger
3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ CHANGELOG
9
9
` Symfony\Component\Messenger\Transport\InMemoryTransportFactory ` in favor of
10
10
` Symfony\Component\Messenger\Transport\InMemory\InMemoryTransport ` and
11
11
` Symfony\Component\Messenger\Transport\InMemory\InMemoryTransportFactory `
12
+ * Allow passing a string instead of an array in ` TransportNamesStamp `
12
13
13
14
6.2
14
15
---
Original file line number Diff line number Diff line change 16
16
*/
17
17
final class TransportNamesStamp implements StampInterface
18
18
{
19
+ private array $ transportNames ;
20
+
19
21
/**
20
- * @param string[] $transports Transport names to be used for the message
22
+ * @param string[]|string $transports Transport names to be used for the message
21
23
*/
22
- public function __construct (private array $ transports )
24
+ public function __construct (array | string $ transports )
23
25
{
26
+ $ this ->transportNames = (array ) $ transports ;
24
27
}
25
28
26
29
public function getTransportNames (): array
27
30
{
28
- return $ this ->transports ;
31
+ return $ this ->transportNames ;
29
32
}
30
33
}
Original file line number Diff line number Diff line change @@ -27,4 +27,13 @@ public function testGetSenders()
27
27
$ this ->assertSame ($ sender , $ stampSenders [$ key ]);
28
28
}
29
29
}
30
+
31
+ public function testGetIndividualSender ()
32
+ {
33
+ $ stamp = new TransportNamesStamp ('first_transport ' );
34
+ $ stampSenders = $ stamp ->getTransportNames ();
35
+
36
+ $ this ->assertCount (1 , $ stampSenders );
37
+ $ this ->assertSame ('first_transport ' , $ stampSenders [0 ]);
38
+ }
30
39
}
You can’t perform that action at this time.
0 commit comments