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.

TestEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 31
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A serialize() 0 4 1
A deserialize() 0 4 1
1
<?php declare (strict_types=1);
2
3
namespace Tests\EventDispatcher\Helpers;
4
5
use SmoothPhp\Contracts\EventSourcing\Event;
6
use SmoothPhp\Contracts\Serialization\Serializable;
7
8
/**
9
 * Class TestEvent
10
 * @package Tests\EventDispatcher\Helpers
11
 * @author Simon Bennett <[email protected]>
12
 */
13
final class TestEvent implements Event, Serializable
14
{
15
    /** @var string */
16
    private $id;
17
18
    /**
19
     * TestEvent constructor.
20
     * @param string $id
21
     */
22
    public function __construct(string $id)
23
    {
24
        $this->id = $id;
25
    }
26
27
    /**
28
     * @return array
29
     */
30
    public function serialize()
31
    {
32
        return ['id' => $this->id];
33
    }
34
35
    /**
36
     * @param array $data
37
     * @return static
38
     */
39
    public static function deserialize(array $data)
40
    {
41
        return new static($data['id']);
42
    }
43
}
44