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.

EventsTracker::release()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
rs 10
ccs 4
cts 4
cp 1
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dsantang\DomainEventsDoctrine;
6
7
use Dsantang\DomainEvents\DomainEvent;
8
9
/**
10
 * Allows a Client to stage domain events that have been raised by the application.
11
 * It then offers a way to release those events at a second moment in time, in order, for example, to dispatch them.
12
 */
13
final class EventsTracker implements Aggregator, Releaser
14
{
15
    /** @var DomainEvent[] */
16
    private array $events = [];
17
18 2
    public function aggregate(DomainEvent ...$events): void
19
    {
20 2
        $this->events = $events;
21 2
    }
22
23
    /**
24
     * @return DomainEvent[]
25
     */
26 1
    public function release(): array
27
    {
28 1
        $events = $this->events;
29
30 1
        $this->events = [];
31
32 1
        return $events;
33
    }
34
}
35