Skip to content

Commit cd36f18

Browse files
committed
[Notifier] [Mattermost] [BC BREAK] Change constructor signature
| Q | A | ------------- | --- | Branch? | 5.x, but BC BREAK for experimental bridge | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | --- | License | MIT | Doc PR | --- Follows #39545
1 parent f2b98b4 commit cd36f18

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

src/Symfony/Component/Notifier/Bridge/Mattermost/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
CHANGELOG
22
=========
33

4+
5.3.0
5+
-----
6+
7+
* [BC BREAK] Changed signature of `MattermostTransport::__construct()` method from:
8+
`public function __construct(string $token, string $channel, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, string $path = null)`
9+
to:
10+
`public function __construct(string $token, string $channel, ?string $path = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)`
11+
412
5.1.0
513
-----
614

src/Symfony/Component/Notifier/Bridge/Mattermost/MattermostTransport.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class MattermostTransport extends AbstractTransport
3131
private $channel;
3232
private $path;
3333

34-
public function __construct(string $token, string $channel, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, string $path = null)
34+
public function __construct(string $token, string $channel, ?string $path = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null)
3535
{
3636
$this->token = $token;
3737
$this->channel = $channel;

src/Symfony/Component/Notifier/Bridge/Mattermost/MattermostTransportFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function create(Dsn $dsn): TransportInterface
4343
$host = $dsn->getHost();
4444
$port = $dsn->getPort();
4545

46-
return (new MattermostTransport($token, $channel, $this->client, $this->dispatcher, $path))->setHost($host)->setPort($port);
46+
return (new MattermostTransport($token, $channel, $path, $this->client, $this->dispatcher))->setHost($host)->setPort($port);
4747
}
4848

4949
protected function getSupportedSchemes(): array

src/Symfony/Component/Notifier/Bridge/Mattermost/Tests/MattermostTransportTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public function testSendNonChatMessageThrowsLogicException()
4949

5050
private function createTransport(): MattermostTransport
5151
{
52-
return (new MattermostTransport('testAccessToken', 'testChannel', $this->createMock(HttpClientInterface::class)))->setHost('host.test');
52+
return (new MattermostTransport('testAccessToken', 'testChannel', null, $this->createMock(HttpClientInterface::class)))->setHost('host.test');
5353
}
5454
}

0 commit comments

Comments
 (0)