Skip to content

Commit 03ea499

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 748db1c commit 03ea499

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

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

Lines changed: 8 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy