ExchangeDeclaredException::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Queue\AMQP\Exception;
6
7
use InvalidArgumentException;
8
use Yiisoft\FriendlyException\FriendlyExceptionInterface;
9
10
class ExchangeDeclaredException extends InvalidArgumentException implements FriendlyExceptionInterface
11
{
12
    protected $message = 'Can\'t set channel name implicitly when an exchange is declared';
13
14
    public function getName(): string
15
    {
16
        return 'Exchange is declared';
17
    }
18
19
    public function getSolution(): ?string
20
    {
21
        return <<<'SOLUTION'
22
            Can't explicitly set channel name when an exchange is declared.
23
24
            Probably, you have called QueueFactory::get() without explicit configuration
25
            for a given channel.
26
            Your QueueProvider configuration has an exchange,
27
            which can't be implicitly binded to a new queue due to differences in behaviors
28
            of different types of exchanges. Please, create an explicit configuration
29
            with a fully-configured adapter for the channel you are trying to create.
30
31
            Reference: https://github.com/yiisoft/yii-queue#different-queue-channels
32
33
            SOLUTION;
34
    }
35
}
36