Changing default serializer in Messenger component to PhpSerializer
This commit is contained in:
parent
3111cef9a4
commit
97e2e32af4
@ -7,6 +7,10 @@ CHANGELOG
|
|||||||
* Added `PhpSerializer` which uses PHP's native `serialize()` and
|
* Added `PhpSerializer` which uses PHP's native `serialize()` and
|
||||||
`unserialize()` to serialize messages to a transport
|
`unserialize()` to serialize messages to a transport
|
||||||
|
|
||||||
|
* [BC BREAK] If no serializer were passed, the default serializer
|
||||||
|
changed from `Serializer` to `PhpSerializer` inside `AmqpReceiver`,
|
||||||
|
`AmqpSender`, `AmqpTransport` and `AmqpTransportFactory`.
|
||||||
|
|
||||||
4.2.0
|
4.2.0
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ namespace Symfony\Component\Messenger\Transport\AmqpExt;
|
|||||||
|
|
||||||
use Symfony\Component\Messenger\Transport\AmqpExt\Exception\RejectMessageExceptionInterface;
|
use Symfony\Component\Messenger\Transport\AmqpExt\Exception\RejectMessageExceptionInterface;
|
||||||
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
|
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
|
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,7 +32,7 @@ class AmqpReceiver implements ReceiverInterface
|
|||||||
public function __construct(Connection $connection, SerializerInterface $serializer = null)
|
public function __construct(Connection $connection, SerializerInterface $serializer = null)
|
||||||
{
|
{
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
$this->serializer = $serializer ?? Serializer::create();
|
$this->serializer = $serializer ?? new PhpSerializer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -13,7 +13,7 @@ namespace Symfony\Component\Messenger\Transport\AmqpExt;
|
|||||||
|
|
||||||
use Symfony\Component\Messenger\Envelope;
|
use Symfony\Component\Messenger\Envelope;
|
||||||
use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
|
use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
|
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -31,7 +31,7 @@ class AmqpSender implements SenderInterface
|
|||||||
public function __construct(Connection $connection, SerializerInterface $serializer = null)
|
public function __construct(Connection $connection, SerializerInterface $serializer = null)
|
||||||
{
|
{
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
$this->serializer = $serializer ?? Serializer::create();
|
$this->serializer = $serializer ?? new PhpSerializer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
namespace Symfony\Component\Messenger\Transport\AmqpExt;
|
namespace Symfony\Component\Messenger\Transport\AmqpExt;
|
||||||
|
|
||||||
use Symfony\Component\Messenger\Envelope;
|
use Symfony\Component\Messenger\Envelope;
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
|
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
||||||
use Symfony\Component\Messenger\Transport\TransportInterface;
|
use Symfony\Component\Messenger\Transport\TransportInterface;
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ class AmqpTransport implements TransportInterface
|
|||||||
public function __construct(Connection $connection, SerializerInterface $serializer = null)
|
public function __construct(Connection $connection, SerializerInterface $serializer = null)
|
||||||
{
|
{
|
||||||
$this->connection = $connection;
|
$this->connection = $connection;
|
||||||
$this->serializer = $serializer ?? Serializer::create();
|
$this->serializer = $serializer ?? new PhpSerializer();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\Messenger\Transport\AmqpExt;
|
namespace Symfony\Component\Messenger\Transport\AmqpExt;
|
||||||
|
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
|
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
|
||||||
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
||||||
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
|
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
|
||||||
use Symfony\Component\Messenger\Transport\TransportInterface;
|
use Symfony\Component\Messenger\Transport\TransportInterface;
|
||||||
@ -28,7 +28,7 @@ class AmqpTransportFactory implements TransportFactoryInterface
|
|||||||
|
|
||||||
public function __construct(SerializerInterface $serializer = null, bool $debug = false)
|
public function __construct(SerializerInterface $serializer = null, bool $debug = false)
|
||||||
{
|
{
|
||||||
$this->serializer = $serializer ?? Serializer::create();
|
$this->serializer = $serializer ?? new PhpSerializer();
|
||||||
$this->debug = $debug;
|
$this->debug = $debug;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user