GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — devel ( df32c1...525bc2 )
by Alex
04:03 queued 28s
created

OutgoingPipelineFeature   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 76.19%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 47
ccs 16
cts 21
cp 0.7619
rs 10
c 0
b 0
f 0

2 Methods

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