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 — master ( 200536...4b06eb )
by Simon
05:26
created

StrongConsistencyCommandBusServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 24
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 16 1
1
<?php declare(strict_types = 1);
2
namespace SmoothPhp\LaravelAdapter\StrongConsistency;
3
4
use Illuminate\Contracts\Foundation\Application;
5
use Illuminate\Support\ServiceProvider;
6
use SmoothPhp\CommandBus\SimpleCommandBus;
7
use SmoothPhp\CommandBus\SimpleCommandTranslator;
8
use SmoothPhp\Contracts\CommandBus\CommandBus;
9
use SmoothPhp\Contracts\CommandBus\CommandTranslator;
10
use SmoothPhp\LaravelAdapter\CommandBus\LaravelCommandBusHandlerResolver;
11
12
/**
13
 * Class StrongConsistencyCommandBusServiceProvider
14
 * @package SmoothPhp\LaravelAdapter\StrongConsistency
15
 * @author Simon Bennett <[email protected]>
16
 */
17
final class StrongConsistencyCommandBusServiceProvider extends ServiceProvider
18
{
19
    /**
20
     * Register the service provider.
21
     *
22
     * @return void
23
     */
24
    public function register()
25
    {
26
        $this->app->bind(CommandTranslator::class, SimpleCommandTranslator::class);
27
28
        $this->app->singleton(
29
            CommandBus::class,
30
            function (Application $application) {
31
                $simpleCommandBus = new SimpleCommandBus(
32
                    $application->make(CommandTranslator::class),
33
                    $application->make(LaravelCommandBusHandlerResolver::class)
34
                );
35
36
                return new StrongConsistencyCommandBus($simpleCommandBus);
37
            }
38
        );
39
    }
40
}
41