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   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 28
rs 10
c 0
b 0
f 0
ccs 0
cts 13
cp 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onFlush() 0 11 2
A __construct() 0 4 1
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