Skip to content

Commit 0148f40

Browse files
Remove full DSNs from exception messages
1 parent 5338bfc commit 0148f40

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Tests/Transport/ConnectionTest.php

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

1212
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Tests\Transport;
1313

14-
use InvalidArgumentException;
1514
use Pheanstalk\Contract\PheanstalkInterface;
1615
use Pheanstalk\Exception;
1716
use Pheanstalk\Exception\ClientException;
@@ -30,8 +29,8 @@ final class ConnectionTest extends TestCase
3029
{
3130
public function testFromInvalidDsn()
3231
{
33-
$this->expectException(InvalidArgumentException::class);
34-
$this->expectExceptionMessage('The given Beanstalkd DSN "beanstalkd://" is invalid.');
32+
$this->expectException(\InvalidArgumentException::class);
33+
$this->expectExceptionMessage('The given Beanstalkd DSN is invalid.');
3534

3635
Connection::fromDsn('beanstalkd://');
3736
}

Transport/Connection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @author Antonio Pauletich <[email protected]>
2424
*
2525
* @internal
26+
*
2627
* @final
2728
*/
2829
class Connection
@@ -58,7 +59,7 @@ public function __construct(array $configuration, PheanstalkInterface $client)
5859
public static function fromDsn(#[\SensitiveParameter] string $dsn, array $options = []): self
5960
{
6061
if (false === $components = parse_url($dsn)) {
61-
throw new InvalidArgumentException(sprintf('The given Beanstalkd DSN "%s" is invalid.', $dsn));
62+
throw new InvalidArgumentException('The given Beanstalkd DSN is invalid.');
6263
}
6364

6465
$connectionCredentials = [

0 commit comments

Comments
 (0)