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.
Test Failed
Pull Request — master (#7)
by Fábio Tadeu da
01:42
created

MapBased::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dsantang\DomainEventsDoctrine\Outbox;
6
7
use Doctrine\ORM\Event\OnFlushEventArgs;
8
9
final class MapBased extends EventsHandler
10
{
11
    /** @var OutboxMappedSuperclass */
12
    private $outboxMappedSuperclass;
13
14
    /** @var array */
15
    private $conversionMap;
16
17
    /**
18
     * @param array $conversionMap
19
     */
20
    public function __construct(OutboxMappedSuperclass $outboxMappedSuperclass, array $conversionMap)
21
    {
22
        $this->outboxMappedSuperclass = $outboxMappedSuperclass;
23
        $this->conversionMap          = $conversionMap;
24
    }
25
26
    public function onFlush(OnFlushEventArgs $eventArgs) : void
27
    {
28
        $domainEvents = $this->getDomainsEvents($eventArgs);
29
30
        $outboxEvents = $this->convert($this->conversionMap, ...$domainEvents);
31
32
        if (empty($outboxEvents)) {
33
            return;
34
        }
35
36
        $this->persist($eventArgs->getEntityManager(), $this->outboxMappedSuperclass, ...$outboxEvents);
37
    }
38
}
39