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::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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