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.

QueuedEventHandler   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A fire() 0 14 1
1
<?php declare(strict_types=1);
2
3
4
namespace SmoothPhp\LaravelAdapter\QueuedEventDispatcher;
5
6
use Illuminate\Container\Container;
7
8
9
/**
10
 * Class QueuedEventHandler
11
 * @package SmoothPhp\LaravelAdapter\QueuedEventDispatcher
12
 * @author Simon Bennett <[email protected]>
13
 */
14
final class QueuedEventHandler
15
{
16
    /** @var Container */
17
    private $container;
18
19
    /**
20
     * QueuedEventHandler constructor.
21
     * @param Container $container
22
     * @internal param $Container
23
     */
24
    public function __construct(Container $container)
25
    {
26
        $this->container = $container;
27
    }
28
29
    /**
30
     * @param $job
31
     * @param $data
32
     */
33
    public function fire($job, $data)
34
    {
35
        $event = call_user_func(
36
            [
37
                str_replace('.', '\\', $data['event']['class']),
38
                'deserialize'
39
            ],
40
            $data['event']['payload']
41
        );
42
43
        $this->container->make($data['listener_class'])->{$data['listener_method']}($event);
44
45
        $job->delete();
46
    }
47
}
48