RuleMatchException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 33
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __destruct() 0 4 1
A __invoke() 0 4 1
1
<?php
2
3
namespace Dazzle\Channel\Router\RuleMatch;
4
5
use Dazzle\Channel\Protocol\ProtocolInterface;
6
use Dazzle\Util\Support\StringSupport;
7
8
class RuleMatchException
9
{
10
    /**
11
     * @var string
12
     */
13
    protected $exception;
14
15
    /**
16
     * @param string $exception
17
     */
18 6
    public function __construct($exception)
19
    {
20 6
        $this->exception = $exception;
21 6
    }
22
23
    /**
24
     *
25
     */
26 6
    public function __destruct()
27
    {
28 6
        unset($this->exception);
29 6
    }
30
31
    /**
32
     * @param string $exception
33
     * @param ProtocolInterface $protocol
34
     * @return bool
35
     */
36 4
    public function __invoke($exception, ProtocolInterface $protocol)
37
    {
38 4
        return StringSupport::match($this->exception, $protocol->getException());
39
    }
40
}
41