Skip to content

Commit 2b0de64

Browse files
committed
Favor LogicException for missing classes & functions
1 parent 3047aa0 commit 2b0de64

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Exception/LogicException.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Messenger\Exception;
13+
14+
/**
15+
* @author Roland Franssen <[email protected]>
16+
*/
17+
class LogicException extends \LogicException implements ExceptionInterface
18+
{
19+
}

Transport/Serialization/Serializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\Messenger\Envelope;
1515
use Symfony\Component\Messenger\Exception\InvalidArgumentException;
16-
use Symfony\Component\Messenger\Exception\RuntimeException;
16+
use Symfony\Component\Messenger\Exception\LogicException;
1717
use Symfony\Component\Serializer\Encoder\JsonEncoder;
1818
use Symfony\Component\Serializer\Encoder\XmlEncoder;
1919
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
@@ -39,7 +39,7 @@ public function __construct(SymfonySerializerInterface $serializer, string $form
3939
public static function create(): self
4040
{
4141
if (!class_exists(SymfonySerializer::class)) {
42-
throw new RuntimeException(sprintf('The default Messenger Serializer requires Symfony\'s Serializer component. Try running "composer require symfony/serializer".'));
42+
throw new LogicException(sprintf('The default Messenger Serializer requires Symfony\'s Serializer component. Try running "composer require symfony/serializer".'));
4343
}
4444

4545
$encoders = array(new XmlEncoder(), new JsonEncoder());

0 commit comments

Comments
 (0)