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.
Passed
Pull Request — master (#7)
by Fábio Tadeu da
02:51 queued 11s
created

OutboxMappedSuperclass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 23
dl 0
loc 89
rs 10
c 0
b 0
f 0
ccs 13
cts 13
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromOutboxEntry() 0 16 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dsantang\DomainEventsDoctrine\Outbox;
6
7
use DateTimeImmutable;
8
use Doctrine\ORM\Mapping as ORM;
9
use Doctrine\ORM\Mapping\MappedSuperclass;
10
use Ramsey\Uuid\Uuid;
11
use Ramsey\Uuid\UuidInterface;
12
13
/**
14
 * @MappedSuperclass
15
 */
16
abstract class OutboxMappedSuperclass
17
{
18
    /**
19
     * @ORM\Id
20
     * @ORM\Column(type="uuid")
21
     *
22
     * @var UuidInterface
23
     */
24
    protected $id;
25
26
    /**
27
     * @ORM\Column(type="string")
28
     *
29
     * @var string
30
     */
31
    protected $messageKey;
32
33
    /**
34
     * @ORM\Column(type="string")
35
     *
36
     * @var string
37
     */
38
    protected $messageRoute;
39
40
    /**
41
     * @ORM\Column(type="string")
42
     *
43
     * @var string
44
     */
45
    protected $messageType;
46
47
    /**
48
     * @ORM\Column(type="uuid")
49
     *
50
     * @var UuidInterface
51
     */
52
    protected $aggregateId;
53
54
    /**
55
     * @ORM\Column(type="string")
56
     *
57
     * @var string
58
     */
59
    protected $aggregateType;
60
61
    /**
62
     * @ORM\Column(type="string")
63
     *
64
     * @var string
65
     */
66
    protected $payloadType;
67
68
    /**
69
     * @ORM\Column(type="json")
70
     *
71
     * @var string
72
     */
73
    protected $payload;
74
75
    /**
76
     * @ORM\Column(type="integer")
77
     *
78
     * @var int
79
     */
80
    protected $schemaVersion;
81
82
    /**
83
     * @ORM\Column(type="utc_datetime_immutable")
84
     *
85
     * @var DateTimeImmutable
86
     */
87
    protected $createdAt;
88
89 3
    public function fromOutboxEntry(OutboxEntry $outboxEntry) : OutboxMappedSuperclass
90
    {
91 3
        $outbox = clone $this;
92
93 3
        $outbox->id            = Uuid::uuid4();
94 3
        $outbox->messageKey    = $outboxEntry->getMessageKey();
95 3
        $outbox->messageRoute  = $outboxEntry->getMessageRoute();
96 3
        $outbox->messageType   = $outboxEntry->getMessageType();
97 3
        $outbox->aggregateId   = $outboxEntry->getAggregateId();
98 3
        $outbox->aggregateType = $outboxEntry->getAggregateType();
99 3
        $outbox->payloadType   = $outboxEntry->getPayloadType();
100 3
        $outbox->payload       = $outboxEntry->getPayload();
101 3
        $outbox->schemaVersion = $outboxEntry->getSchemaVersion();
102 3
        $outbox->createdAt     = new DateTimeImmutable();
103
104 3
        return $outbox;
105
    }
106
}
107