AttachReplyToAddressPipelineStep   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 34
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A invoke() 0 6 1
A getStageContextClass() 0 4 1
1
<?php
2
namespace PSB\Core\Routing\Pipeline;
3
4
5
use PSB\Core\HeaderTypeEnum;
6
use PSB\Core\Pipeline\Outgoing\StageContext\OutgoingLogicalMessageContext;
7
use PSB\Core\Pipeline\PipelineStepInterface;
8
9
class AttachReplyToAddressPipelineStep implements PipelineStepInterface
10
{
11
    /**
12
     * @var string
13
     */
14
    private $replyToAddress;
15
16
    /**
17
     * @param string $replyToAddress
18
     */
19 4
    public function __construct($replyToAddress)
20
    {
21 4
        $this->replyToAddress = $replyToAddress;
22 4
    }
23
24
    /**
25
     * @param OutgoingLogicalMessageContext $context
26
     * @param callable                      $next
27
     */
28 2
    public function invoke($context, callable $next)
29
    {
30 2
        $context->setHeader(HeaderTypeEnum::REPLY_TO_ADDRESS, $this->replyToAddress);
31
32 2
        $next();
33 2
    }
34
35
    /**
36
     * @return string
37
     */
38 1
    public static function getStageContextClass()
39
    {
40 1
        return OutgoingLogicalMessageContext::class;
41
    }
42
}
43