PushPipe   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A push() 0 6 1
1
<?php
2
namespace PSB\Core\Transport;
3
4
5
use PSB\Core\Pipeline\PipelineInterface;
6
7
class PushPipe
8
{
9
    /**
10
     * @var TransportReceiveContextFactory
11
     */
12
    private $contextFactory;
13
14
    /**
15
     * @var PipelineInterface
16
     */
17
    private $pipeline;
18
19
    /**
20
     * @param TransportReceiveContextFactory $contextFactory
21
     * @param PipelineInterface              $pipeline
22
     */
23 2
    public function __construct(TransportReceiveContextFactory $contextFactory, PipelineInterface $pipeline)
24
    {
25 2
        $this->contextFactory = $contextFactory;
26 2
        $this->pipeline = $pipeline;
27 2
    }
28
29
    /**
30
     * @param PushContext $pushContext
31
     */
32 1
    public function push(PushContext $pushContext)
33
    {
34 1
        $transportReceiveContext = $this->contextFactory->createFromPushContext($pushContext);
35
36 1
        $this->pipeline->invoke($transportReceiveContext);
37 1
    }
38
}
39