SubscriptionApplierStartupTask   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
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 25
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A start() 0 6 2
1
<?php
2
namespace PSB\Core\Routing\AutoSubscription;
3
4
5
use PSB\Core\BusContextInterface;
6
use PSB\Core\Feature\FeatureStartupTaskInterface;
7
8
class SubscriptionApplierStartupTask implements FeatureStartupTaskInterface
9
{
10
    /**
11
     * @var string[]
12
     */
13
    private $messageFqcnsHandledByThisEndpoint;
14
15
    /**
16
     * @param string[] $messageFqcnsHandledByThisEndpoint
17
     */
18 3
    public function __construct(array $messageFqcnsHandledByThisEndpoint)
19
    {
20 3
        $this->messageFqcnsHandledByThisEndpoint = $messageFqcnsHandledByThisEndpoint;
21 3
    }
22
23
    /**
24
     * @param BusContextInterface $busContext
25
     */
26 2
    public function start(BusContextInterface $busContext)
27
    {
28 2
        foreach ($this->messageFqcnsHandledByThisEndpoint as $messageFqcn) {
29 1
            $busContext->subscribe($messageFqcn);
30
        }
31 2
    }
32
}
33