RuleMatchPid   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
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
7
class RuleMatchPid
8
{
9
    /**
10
     * @var string
11
     */
12
    protected $pid;
13
14
    /**
15
     * @param string $pid
16
     */
17 6
    public function __construct($pid)
18
    {
19 6
        $this->pid = $pid;
20 6
    }
21
22
    /**
23
     *
24
     */
25 6
    public function __destruct()
26
    {
27 6
        unset($this->pid);
28 6
    }
29
30
    /**
31
     * @param string $name
32
     * @param ProtocolInterface $protocol
33
     * @return bool
34
     */
35 4
    public function __invoke($name, ProtocolInterface $protocol)
36
    {
37 4
        return $protocol->getPid() === $this->pid;
38
    }
39
}
40