Skip to content

Commit f49955c

Browse files
committed
cs(mongodb): Fix legacy code for new coding standards
1 parent 8bf43ce commit f49955c

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

MongodbConnectionFactory.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ public static function parseDsn(string $dsn): array
7777
'mongodb' => true,
7878
];
7979
if (false == isset($parsedUrl['scheme'])) {
80-
throw new \LogicException(sprintf(
81-
'The given DSN schema "%s" is not supported. There are supported schemes: "%s".',
82-
$parsedUrl['scheme'],
83-
implode('", "', array_keys($supported))
84-
));
80+
throw new \LogicException(sprintf('The given DSN schema "%s" is not supported. There are supported schemes: "%s".', $parsedUrl['scheme'], implode('", "', array_keys($supported))));
8581
}
8682
if ('mongodb:' === $dsn) {
8783
return [

MongodbProducer.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,7 @@ public function send(Destination $destination, Message $message): void
7777
$delay = $message->getDeliveryDelay();
7878
if ($delay) {
7979
if (!is_int($delay)) {
80-
throw new \LogicException(sprintf(
81-
'Delay must be integer but got: "%s"',
82-
is_object($delay) ? get_class($delay) : gettype($delay)
83-
));
80+
throw new \LogicException(sprintf('Delay must be integer but got: "%s"', is_object($delay) ? get_class($delay) : gettype($delay)));
8481
}
8582

8683
if ($delay <= 0) {
@@ -93,10 +90,7 @@ public function send(Destination $destination, Message $message): void
9390
$timeToLive = $message->getTimeToLive();
9491
if ($timeToLive) {
9592
if (!is_int($timeToLive)) {
96-
throw new \LogicException(sprintf(
97-
'TimeToLive must be integer but got: "%s"',
98-
is_object($timeToLive) ? get_class($timeToLive) : gettype($timeToLive)
99-
));
93+
throw new \LogicException(sprintf('TimeToLive must be integer but got: "%s"', is_object($timeToLive) ? get_class($timeToLive) : gettype($timeToLive)));
10094
}
10195

10296
if ($timeToLive <= 0) {

0 commit comments

Comments
 (0)