From 39bdf5521467918d4fbed8437030ac050620e554 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 23 Jan 2023 14:36:51 +0100 Subject: [PATCH] Remove full DSNs from exception messages --- Tests/Transport/ConnectionTest.php | 2 +- Transport/Connection.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Transport/ConnectionTest.php b/Tests/Transport/ConnectionTest.php index 4c135cd..06ef855 100644 --- a/Tests/Transport/ConnectionTest.php +++ b/Tests/Transport/ConnectionTest.php @@ -30,7 +30,7 @@ final class ConnectionTest extends TestCase public function testFromInvalidDsn() { $this->expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('The given Beanstalkd DSN "beanstalkd://" is invalid.'); + $this->expectExceptionMessage('The given Beanstalkd DSN is invalid.'); Connection::fromDsn('beanstalkd://'); } diff --git a/Transport/Connection.php b/Transport/Connection.php index a8aaeae..7ce26ee 100644 --- a/Transport/Connection.php +++ b/Transport/Connection.php @@ -59,7 +59,7 @@ public function __construct(array $configuration, PheanstalkInterface $client) public static function fromDsn(string $dsn, array $options = []): self { if (false === $components = parse_url($dsn)) { - throw new InvalidArgumentException(sprintf('The given Beanstalkd DSN "%s" is invalid.', $dsn)); + throw new InvalidArgumentException('The given Beanstalkd DSN is invalid.'); } $connectionCredentials = [