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

AutoSubscribeFeature::describe()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1.0019

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 8
cp 0.875
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 0
crap 1.0019
1
<?php
2
namespace PSB\Core\Routing\AutoSubscription;
3
4
5
use PSB\Core\Feature\Feature;
6
use PSB\Core\KnownSettingsEnum;
7
use PSB\Core\MessageHandlerRegistry;
8
use PSB\Core\ObjectBuilder\BuilderInterface;
9
use PSB\Core\Pipeline\PipelineModifications;
10
use PSB\Core\Util\Settings;
11
12
class AutoSubscribeFeature extends Feature
13
{
14
15 1
    public function describe()
16
    {
17 1
        $this->enableByDefault();
18 1
        $this->registerPrerequisite(
19 1
            function (Settings $settings) {
20
                return !$settings->tryGet(KnownSettingsEnum::SEND_ONLY);
21 1
            },
22 1
            "Send only endpoints can't autosubscribe."
23
        );
24 1
    }
25
26
    /**
27
     * @param Settings              $settings
28
     * @param BuilderInterface      $builder
29
     * @param PipelineModifications $pipelineModifications
30
     */
31
    public function setup(Settings $settings, BuilderInterface $builder, PipelineModifications $pipelineModifications)
32
    {
33
        $this->registerStartupTask(
34
            function (BuilderInterface $builder) {
35
                /** @var MessageHandlerRegistry $handlerRegistry */
36
                $handlerRegistry = $builder->build(MessageHandlerRegistry::class);
37
                return new SubscriptionApplierStartupTask($handlerRegistry->getEventFqcns());
38
            }
39
        );
40
    }
41
}
42