8000 feature #41298 [Notifier] Remove deprecation in slack-notifier (jscha… · symfony/symfony@5344dc2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5344dc2

Browse files
feature #41298 [Notifier] Remove deprecation in slack-notifier (jschaedl)
This PR was squashed before being merged into the 6.0 branch. Discussion ---------- [Notifier] Remove deprecation in slack-notifier | Q | A | ------------- | --- | Branch? | 6.0 | Bug fix? | no | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | - <!-- required for new features --> <!-- Replace this notice by a short README for your feature/bugfix. This will help people understand your PR and can be used as a start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Never break backward compatibility (see https://symfony.com/bc). - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against branch 5.x. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry --> Commits ------- 1c7d5b9 [Notifier] Remove deprecation in slack-notifier
2 parents 2557a40 + 1c7d5b9 commit 5344dc2

File tree

6 files changed

+5
-43
lines changed

6 files changed

+5
-43
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
6.0
5+
---
6+
7+
* Remove `SlackOptions::channel()`, use `SlackOptions::recipient()` instead
8+
49
5.3
510
---
611

src/Symfony/Component/Notifier/Bridge/Slack/SlackOptions.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,6 @@ public function getRecipientId(): ?string
5858
return $this->options['recipient_id'] ?? null;
5959
}
6060

61-
/**
62-
* @return $this
63-
*
64-
* @deprecated since Symfony 5.1, use recipient() instead.
65-
*/
66-
public function channel(string $channel): self
67-
{
68-
trigger_deprecation('symfony/slack-notifier', '5.1', 'The "%s()" method is deprecated, use "recipient()" instead.', __METHOD__);
69-
70-
return $this;
71-
}
72-
7361
/**
7462
* @param string $id The hook id (anything after https://hooks.slack.com/services/)
7563
*

src/Symfony/Component/Notifier/Bridge/Slack/SlackTransportFactory.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Notifier\Bridge\Slack;
1313

14-
use Symfony\Component\Notifier\Exception\IncompleteDsnException;
1514
use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
1615
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
1716
use Symfony\Component\Notifier\Transport\Dsn;
@@ -31,10 +30,6 @@ public function create(Dsn $dsn): TransportInterface
3130
throw new UnsupportedSchemeException($dsn, 'slack', $this->getSupportedSchemes());
3231
}
3332

34-
if ('/' !== $dsn->getPath() && null !== $dsn->getPath()) {
35-
throw new IncompleteDsnException('Support for Slack webhook DSN has been dropped since 5.2 (maybe you haven\'t updated the DSN when upgrading from 5.1).');
36-
}
37-
3833
$accessToken = $this->getUser($dsn);
3934
$channel = $dsn->getOption('channel');
4035
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();

src/Symfony/Component/Notifier/Bridge/Slack/Tests/SlackOptionsTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\Notifier\Bridge\Slack\Tests;
1313

1414
use PHPUnit\Framework\TestCase;
15-
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
1615
use Symfony\Component\Notifier\Bridge\Slack\Block\SlackDividerBlock;
1716
use Symfony\Component\Notifier\Bridge\Slack\SlackOptions;
1817
use Symfony\Component\Notifier\Notification\Notification;
@@ -22,8 +21,6 @@
2221
*/
2322
final class SlackOptionsTest extends TestCase
2423
{
25-
use ExpectDeprecationTrait;
26-
2724
/**
2825
* @dataProvider toArrayProvider
2926
* @dataProvider toArraySimpleOptionsProvider
@@ -122,16 +119,6 @@ public function testSetBlock()
122119
$this->assertSame([['type' => 'divider']], $options->toArray()['blocks']);
123120
}
124121

125-
/**
126-
* @group legacy
127-
*/
128-
public function testChannelMethodRaisesDeprecation()
129-
{
130-
$this->expectDeprecation('Since symfony/slack-notifier 5.1: The "Symfony\Component\Notifier\Bridge\Slack\SlackOptions::channel()" method is deprecated, use "recipient()" instead.');
131-
132-
(new SlackOptions())->channel('channel');
133-
}
134-
135122
/**
136123
* @dataProvider fromNotificationProvider
137124
*/

src/Symfony/Component/Notifier/Bridge/Slack/Tests/SlackTransportFactoryTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212
namespace Symfony\Component\Notifier\Bridge\Slack\Tests;
1313

1414
use Symfony\Component\Notifier\Bridge\Slack\SlackTransportFactory;
15-
use Symfony\Component\Notifier\Exception\InvalidArgumentException;
1615
use Symfony\Component\Notifier\Test\TransportFactoryTestCase;
17-
use Symfony\Component\Notifier\Transport\Dsn;
1816
use Symfony\Component\Notifier\Transport\TransportFactoryInterface;
1917

2018
final class SlackTransportFactoryTest extends TransportFactoryTestCase
@@ -45,16 +43,6 @@ public function createProvider(): iterable
4543
];
4644
}
4745

48-
public function testCreateWithDeprecatedDsn()
49-
{
50-
$factory = $this->createFactory();
51-
52-
$this->expectException(InvalidArgumentException::class);
53-
$this->expectExceptionMessage('Support for Slack webhook DSN has been dropped since 5.2 (maybe you haven\'t updated the DSN when upgrading from 5.1).');
54-
55-
$factory->create(new Dsn('slack://default/XXXXXXXXX/XXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXX'));
56-
}
57-
5846
public function supportsProvider(): iterable
5947
{
6048
yield [true, 'slack://xoxb-TestToken@host?channel=testChannel'];

src/Symfony/Component/Notifier/Bridge/Slack/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
],
1818
"require": {
1919
"php": ">=8.0.2",
20-
"symfony/deprecation-contracts": "^2.1",
2120
"symfony/http-client": "^5.4|^6.0",
2221
"symfony/notifier": "^5.4|^6.0"
2322
},

0 commit comments

Comments
 (0)
0