@@ -31,33 +31,18 @@ final class ToolsPublisher
3131 private $ encoder ;
3232
3333 /**
34- * @param string $envPath
35- *
3634 * @throws \Symfony\Component\Dotenv\Exception\FormatException
3735 * @throws \Symfony\Component\Dotenv\Exception\PathException
3836 */
3937 public function __construct (string $ envPath )
4038 {
41- (new Dotenv ())->load ($ envPath );
39+ (new Dotenv (true ))->load ($ envPath );
4240
4341 $ this ->encoder = new SymfonyMessageSerializer ();
4442 }
4543
4644 /**
4745 * Send message to queue.
48- *
49- * @param object $message
50- * @param string|null $traceId
51- * @param string|null $topic
52- * @param string|null $routingKey
53- *
54- * @throws \ServiceBus\MessageSerializer\Exceptions\EncodeMessageFailed
55- * @throws \ServiceBus\Transport\Common\Exceptions\InvalidConnectionParameters
56- * @throws \ServiceBus\Transport\Common\Exceptions\SendMessageFailed
57- * @throws \Throwable
58- *
59- * @return void
60- *
6146 */
6247 public function sendMessage (object $ message , string $ traceId = null , ?string $ topic = null , ?string $ routingKey = null ): void
6348 {
@@ -67,7 +52,7 @@ public function sendMessage(object $message, string $traceId = null, ?string $to
6752 /** @noinspection PhpUnhandledExceptionInspection */
6853 wait (
6954 $ this ->transport ()->send (
70- OutboundPackage:: create (
55+ new OutboundPackage (
7156 $ this ->encoder ->encode ($ message ),
7257 [Transport::SERVICE_BUS_TRACE_HEADER => $ traceId ?? uuid ()],
7358 new AmqpTransportLevelDestination ($ topic , $ routingKey ),
@@ -77,14 +62,6 @@ public function sendMessage(object $message, string $traceId = null, ?string $to
7762 );
7863 }
7964
80- /**
81- * @noinspection PhpDocMissingThrowsInspection
82- *
83- * @throws \ServiceBus\Transport\Common\Exceptions\InvalidConnectionParameters
84- *
85- * @return Transport
86- *
87- */
8865 private function transport (): Transport
8966 {
9067 if (null === $ this ->transport )
0 commit comments