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:12
created

OutboxMappedSuperclass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 87
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 21
dl 0
loc 87
rs 10
c 0
b 0
f 0
ccs 11
cts 11
cp 1

1 Method

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