MethodNotSupportedException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 38
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 3 1
A __construct() 0 15 1
1
<?php
2
3
/**
4
 * This file is part of graze/queue.
5
 *
6
 * Copyright (c) 2015 Nature Delivered Ltd. <https://www.graze.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @license https://github.com/graze/queue/blob/master/LICENSE MIT
12
 *
13
 * @link    https://github.com/graze/queue
14
 */
15
16
namespace Graze\Queue\Adapter\Exception;
17
18
use Exception;
19
use Graze\Queue\Adapter\AdapterInterface;
20
use Graze\Queue\Message\MessageInterface;
21
22
/**
23
 * Exception to throw when an implmentation of {@see \Graze\Queue\AdapterInterface}
24
 * does not support a method on {@see \Graze\Queue\Adapter\AdapterInterface}.
25
 */
26
class MethodNotSupportedException extends AdapterException
27
{
28
    /**
29
     * @var string
30
     */
31
    protected $method;
32
33
    /**
34
     * @param string             $method
35
     * @param AdapterInterface   $adapter
36
     * @param MessageInterface[] $messages
37
     * @param array              $debug
38
     * @param Exception          $previous
39
     */
40 10
    public function __construct(
41
        $method,
42
        AdapterInterface $adapter,
43
        array $messages,
44
        array $debug = [],
45
        Exception $previous = null
46
    ) {
47 10
        $this->method = $method;
48
49 10
        parent::__construct(
50 10
            sprintf('Method `%s` is not supported by this adapter', $method),
51 10
            $adapter,
52 10
            $messages,
53 10
            $debug,
54
            $previous
55 10
        );
56 10
    }
57
58
    /**
59
     * @return string
60
     */
61 1
    public function getMethod()
62
    {
63 1
        return $this->method;
64
    }
65
}
66