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

StrongConsistencyCommandBus::execute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php declare(strict_types = 1);
2
namespace SmoothPhp\LaravelAdapter\StrongConsistency;
3
4
use SmoothPhp\CommandBus\SimpleCommandBus;
5
use SmoothPhp\Contracts\CommandBus\Command;
6
use SmoothPhp\Contracts\CommandBus\CommandBus;
7
8
/**
9
 * Class CommandBus
10
 * @package SmoothPhp\LaravelAdapter\StrongConsistency
11
 * @author Simon Bennett <[email protected]>
12
 */
13
final class StrongConsistencyCommandBus implements CommandBus
14
{
15
    /** @var SimpleCommandBus */
16
    private $commandBus;
17
18
    /** @var string */
19
    private $lastCommandId;
20
21
    /**
22
     * NotificationsCommandBus constructor.
23
     * @param SimpleCommandBus $commandBus
24
     */
25
    public function __construct(SimpleCommandBus $commandBus)
26
    {
27
        $this->commandBus = $commandBus;
28
    }
29
30
    /**
31
     * @param Command $command
32
     * @return void
33
     */
34
    public function execute(Command $command)
35
    {
36
        $this->lastCommandId = (string)$command;
37
        $this->commandBus->execute($command);
38
    }
39
40
    /**
41
     * @return string
42
     */
43
    public function getLastCommandId()
44
    {
45
        return $this->lastCommandId;
46
    }
47
}
48