MessageCorrelationFeature   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 90%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 35
ccs 9
cts 10
cp 0.9
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A describe() 0 4 1
A setup() 0 13 1
1
<?php
2
namespace PSB\Core\Correlation;
3
4
5
use PSB\Core\Correlation\Pipeline\AttachCorrelationIdPipelineStep;
6
use PSB\Core\Feature\Feature;
7
use PSB\Core\ObjectBuilder\BuilderInterface;
8
use PSB\Core\Pipeline\PipelineModifications;
9
use PSB\Core\Util\Settings;
10
11
class MessageCorrelationFeature extends Feature
12
{
13
14
    /**
15
     * Method will always be executed and should be used to determine whether to enable or disable the feature,
16
     * configure default settings, configure dependencies, configure prerequisites and register startup tasks.
17
     */
18 1
    public function describe()
19
    {
20 1
        $this->enableByDefault();
21 1
    }
22
23
    /**
24
     * Method is called if all defined conditions are met and the feature is marked as enabled.
25
     * Use this method to configure and initialize all required components for the feature like
26
     * the steps in the pipeline or the instances/factories in the container.
27
     *
28
     * @param Settings              $settings
29
     * @param BuilderInterface      $builder
30
     * @param PipelineModifications $pipelineModifications
31
     */
32 1
    public function setup(
33
        Settings $settings,
34
        BuilderInterface $builder,
35
        PipelineModifications $pipelineModifications
36
    ) {
37 1
        $pipelineModifications->registerStep(
38 1
            'AttachCorrelationIdPipelineStep',
39 1
            AttachCorrelationIdPipelineStep::class,
40
            function () {
41
                return new AttachCorrelationIdPipelineStep();
42 1
            }
43
        );
44 1
    }
45
}
46