8000 Removed some more code · symfony/symfony@2781c25 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2781c25

Browse files
committed
Removed some more code
1 parent d328c1f commit 2781c25

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Connection
5555
private $deleteAfterReject;
5656
private $couldHavePendingMessages = true;
5757

58-
public function __construct(array $configuration, array $connectionCredentials = [], array $redisOptions = [], \Redis|\RedisCluster $redis = null)
58+
public function __construct(array $configuration, array $connectionCredentials = [], array $redisOptions = [], \Redis | \RedisCluster $redis = null)
5959
{
6060
if (version_compare(phpversion('redis'), '4.3.0', '<')) {
6161
throw new LogicException('The redis transport requires php-redis 4.3.0 or higher.');
@@ -132,7 +132,7 @@ private static function initializeRedisCluster(?\RedisCluster $redis, array $hos
132132
return $redis;
133133
}
134134

135-
public static function fromDsn(string $dsn, array $redisOptions = [], \Redis|\RedisCluster $redis = null): self
135+
public static function fromDsn(string $dsn, array $redisOptions = [], \Redis | \RedisCluster $redis = null): self
136136
{
137137
if (false === strpos($dsn, ',')) {
138138
$parsedUrl = self::parseDsn($dsn, $redisOptions);

src/Symfony/Component/Messenger/Command/AbstractFailedMessagesCommand.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ protected function displaySingleMessage(Envelope $envelope, SymfonyStyle $io)
8383
$lastRedeliveryStamp = $envelope->last(RedeliveryStamp::class);
8484
/** @var ErrorDetailsStamp|null $lastErrorDetailsStamp */
8585
$lastErrorDetailsStamp = $envelope->last(ErrorDetailsStamp::class);
86-
$lastRedeliveryStampWithException = $this->getLastRedeliveryStampWithException($envelope, true);
8786

8887
$rows = [
8988
['Class', \get_class($envelope->getMessage())],
@@ -109,12 +108,6 @@ protected function displaySingleMessage(Envelope $envelope, SymfonyStyle $io)
109108
$errorMessage = $lastErrorDetailsStamp->getExceptionMessage();
110109
$errorCode = $lastErrorDetailsStamp->getExceptionCode();
111110
$errorClass = $lastErrorDetailsStamp->getExceptionClass();
112-
} elseif (null !== $lastRedeliveryStampWithException) {
113-
// Try reading the errorMessage for messages that are still in the queue without the new ErrorDetailStamps.
114-
$errorMessage = $lastRedeliveryStampWithException->getExceptionMessage();
115-
if (null !== $lastRedeliveryStampWithException->getFlattenException()) {
116-
$errorClass = $lastRedeliveryStampWithException->getFlattenException()->getClass();
117-
}
118111
}
119112

120113
$rows = array_merge($rows, [
@@ -144,8 +137,6 @@ protected function displaySingleMessage(Envelope $envelope, SymfonyStyle $io)
144137
$flattenException = null;
145138
if (null !== $lastErrorDetailsStamp) {
146139
$flattenException = $lastErrorDetailsStamp->getFlattenException();
147-
} elseif (null !== $lastRedeliveryStampWithException) {
148-
$flattenException = $lastRedeliveryStampWithException->getFlattenException();
149140
}
150141
$io->writeln(null === $flattenException ? '(no data)' : $dump($flattenException));
151142
} else {
@@ -177,27 +168,6 @@ protected function getReceiver(string $name = null): ReceiverInterface
177168
return $this->failureTransports->get($name);
178169
}
179170

180-
protected function getLastRedeliveryStampWithException(Envelope $envelope): ?RedeliveryStamp
181-
{
182-
if (null === \func_get_args()[1]) {
183-
trigger_deprecation('symfony/messenger', '5.2', sprintf('Using the "getLastRedeliveryStampWithException" method in the "%s" class is deprecated, use the "Envelope::last(%s)" instead.', self::class, ErrorDetailsStamp::class));
184-
}
185-
186-
// Use ErrorDetailsStamp instead if it is available
187-
if (null !== $envelope->last(ErrorDetailsStamp::class)) {
188-
return null;
189-
}
190-
191-
/** @var RedeliveryStamp $stamp */
192-
foreach (array_reverse($envelope->all(RedeliveryStamp::class)) as $stamp) {
193-
if (null !== $stamp->getExceptionMessage()) {
194-
return $stamp;
195-
}
196-
}
197-
198-
return null;
199-
}
200-
201171
private function createCloner(): ?ClonerInterface
202172
{
203173
if (!class_exists(VarCloner::class)) {

0 commit comments

Comments
 (0)
0