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

QueueToEventDispatcherWithCommandId::fire()   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 2
1
<?php declare(strict_types = 1);
2
namespace SmoothPhp\LaravelAdapter\StrongConsistency;
3
4
use Carbon\Carbon;
5
use Illuminate\Contracts\Cache\Repository as Cache;
6
use SmoothPhp\LaravelAdapter\EventBus\QueueToEventDispatcher;
7
/**
8
 * Class QueueToEventDispatcherWithCommandId
9
 * @package SmoothPhp\LaravelAdapter\StrongConsistency
10
 * @author Simon Bennett <[email protected]>
11
 */
12
final class QueueToEventDispatcherWithCommandId
13
{
14
    /** @var QueueToEventDispatcher */
15
    private $queueToEventDispatcher;
16
17
    /** @var Cache */
18
    private $cache;
19
20
    /**
21
     * QueueToEventDispatcherWithCommandId constructor.
22
     * @param QueueToEventDispatcher $queueToEventDispatcher
23
     * @param Cache $cache
24
     */
25
    public function __construct(QueueToEventDispatcher $queueToEventDispatcher, Cache $cache)
26
    {
27
        $this->queueToEventDispatcher = $queueToEventDispatcher;
28
        $this->cache = $cache;
29
    }
30
31
    /**
32
     * @param $job
33
     * @param $data
34
     * @return mixed
35
     */
36
    public function fire($job, $data)
37
    {
38
        $this->queueToEventDispatcher->fire($job, $data);
39
        $this->cache->add($data['command_id'], new Carbon(), 1);
40
    }
41
}
42