Skip to content

Commit

Permalink
Revert "minor #45899 [Messenger] [Security/Core] Remove legacy class …
Browse files Browse the repository at this point in the history
…aliases (nicolas-grekas)"

This reverts commit 758ed6bf66648a17432496162cd02215b8809df4, reversing
changes made to 1bd3af4ec6303a4cf3de0218abc29ca9fdd7a793.
  • Loading branch information
nicolas-grekas committed Mar 31, 2022
1 parent 86b2235 commit ea0266d
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Transport/AmqpFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ public function createExchange(\AMQPChannel $channel): \AMQPExchange
return new \AMQPExchange($channel);
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory::class, false)) {
class_alias(AmqpFactory::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpFactory::class);
}
4 changes: 4 additions & 0 deletions Transport/AmqpReceivedStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ public function getQueueName(): string
return $this->queueName;
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceivedStamp::class, false)) {
class_alias(AmqpReceivedStamp::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceivedStamp::class);
}
4 changes: 4 additions & 0 deletions Transport/AmqpReceiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,7 @@ private function findAmqpStamp(Envelope $envelope): AmqpReceivedStamp
return $amqpReceivedStamp;
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceiver::class, false)) {
class_alias(AmqpReceiver::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpReceiver::class);
}
4 changes: 4 additions & 0 deletions Transport/AmqpSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,7 @@ public function send(Envelope $envelope): Envelope
return $envelope;
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpSender::class, false)) {
class_alias(AmqpSender::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpSender::class);
}
4 changes: 4 additions & 0 deletions Transport/AmqpStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,7 @@ public static function createWithAttributes(array $attributes, self $previousSta
);
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpStamp::class, false)) {
class_alias(AmqpStamp::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpStamp::class);
}
4 changes: 4 additions & 0 deletions Transport/AmqpTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,7 @@ private function getSender(): AmqpSender
return $this->sender = new AmqpSender($this->connection, $this->serializer);
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport::class, false)) {
class_alias(AmqpTransport::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransport::class);
}
4 changes: 4 additions & 0 deletions Transport/AmqpTransportFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ public function supports(string $dsn, array $options): bool
return 0 === strpos($dsn, 'amqp://') || 0 === strpos($dsn, 'amqps://');
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransportFactory::class, false)) {
class_alias(AmqpTransportFactory::class, \Symfony\Component\Messenger\Transport\AmqpExt\AmqpTransportFactory::class);
}
4 changes: 4 additions & 0 deletions Transport/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,7 @@ private function getRoutingKeyForMessage(?AmqpStamp $amqpStamp): ?string
return (null !== $amqpStamp ? $amqpStamp->getRoutingKey() : null) ?? $this->getDefaultPublishRoutingKey();
}
}

if (!class_exists(\Symfony\Component\Messenger\Transport\AmqpExt\Connection::class, false)) {
class_alias(Connection::class, \Symfony\Component\Messenger\Transport\AmqpExt\Connection::class);
}

0 comments on commit ea0266d

Please sign in to comment.