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.

EventsRegistry::triggeredA()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dsantang\DomainEvents\Registry;
6
7
use Dsantang\DomainEvents\DomainEvent;
8
use Dsantang\DomainEvents\EventAware;
9
10
trait EventsRegistry
11
{
12
    /** @var DomainEvent[] */
13
    private $recordedEvents = [];
14
15
    /**
16
     * @return DomainEvent[]
17
     */
18 3
    public function expelRecordedEvents() : array
19
    {
20 3
        if ($this instanceof EventAware === false) {
21 1
            throw IncompatibleClass::forExpellingEvents($this);
22
        }
23
24 2
        $recordedEvents = $this->recordedEvents;
25
26 2
        $this->recordedEvents = [];
27
28 2
        return $recordedEvents;
29
    }
30
31 2
    private function triggeredA(DomainEvent $event) : void
32
    {
33 2
        if ($this instanceof EventAware === false) {
34 1
            throw IncompatibleClass::forTriggeringEvents($this);
35
        }
36
37 1
        $this->recordedEvents[] = $event;
38 1
    }
39
}
40