Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Symfony/Component/Messenger/Handler/ChainHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Messenger\Handler;

use Symfony\Component\Messenger\Exception\InvalidArgumentException;

/**
* Represents a collection of message handlers.
*
Expand All @@ -29,7 +31,7 @@ class ChainHandler
public function __construct(array $handlers)
{
if (empty($handlers)) {
throw new \InvalidArgumentException('A collection of message handlers requires at least one handler.');
throw new InvalidArgumentException('A collection of message handlers requires at least one handler.');
}

$this->handlers = $handlers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Messenger\Transport\AmqpExt;

use Symfony\Component\Messenger\Exception\InvalidArgumentException;

/**
* An AMQP connection.
*
Expand Down Expand Up @@ -51,7 +53,7 @@ public function __construct(array $connectionCredentials, array $exchangeConfigu
public static function fromDsn(string $dsn, array $options = array(), bool $debug = false, AmqpFactory $amqpFactory = null): self
{
if (false === $parsedUrl = parse_url($dsn)) {
throw new \InvalidArgumentException(sprintf('The given AMQP DSN "%s" is invalid.', $dsn));
throw new InvalidArgumentException(sprintf('The given AMQP DSN "%s" is invalid.', $dsn));
}

$pathParts = isset($parsedUrl['path']) ? explode('/', trim($parsedUrl['path'], '/')) : array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Component\Messenger\Transport\Serialization;

use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\InvalidArgumentException;
use Symfony\Component\Serializer\SerializerInterface;

/**
Expand All @@ -36,11 +37,11 @@ public function __construct(SerializerInterface $serializer, string $format = 'j
public function decode(array $encodedEnvelope): Envelope
{
if (empty($encodedEnvelope['body']) || empty($encodedEnvelope['headers'])) {
throw new \InvalidArgumentException('Encoded envelope should have at least a `body` and some `headers`.');
throw new InvalidArgumentException('Encoded envelope should have at least a "body" and some "headers".');
}

if (empty($encodedEnvelope['headers']['type'])) {
throw new \InvalidArgumentException('Encoded envelope does not have a `type` header.');
throw new InvalidArgumentException('Encoded envelope does not have a "type" header.');
}

$envelopeItems = $this->decodeEnvelopeItems($encodedEnvelope);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

namespace Symfony\Component\Messenger\Transport;

use Symfony\Component\Messenger\Exception\InvalidArgumentException;

/**
* @author Samuel Roze <samuel.roze@gmail.com>
*/
Expand All @@ -34,7 +36,7 @@ public function createTransport(string $dsn, array $options): TransportInterface
}
}

throw new \InvalidArgumentException(sprintf('No transport supports the given DSN "%s".', $dsn));
throw new InvalidArgumentException(sprintf('No transport supports the given DSN "%s".', $dsn));
}

public function supports(string $dsn, array $options): bool
Expand Down