Passed
Push — dev ( eeaa0f...91a85a )
by Janko
26:10
created

AnomalyCreationEventStrategy   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getEntitiesToLock() 0 3 1
A processEvent() 0 3 1
1
<?php
2
3
namespace Stu\Component\Event\Strategy;
4
5
use Doctrine\Common\Collections\ArrayCollection;
6
use Doctrine\Common\Collections\Collection;
7
use Stu\Component\Anomaly\AnomalyHandlingInterface;
8
use Stu\Orm\Entity\EventInterface;
9
10
class AnomalyCreationEventStrategy implements EventStrategyInterface
11
{
12
    public function __construct(
13
        private AnomalyHandlingInterface $anomalyHandling,
14
    ) {
15
    }
16
17
    public function getEntitiesToLock(EventInterface $event): Collection
18
    {
19
        return new ArrayCollection();
20
    }
21
22
    public function processEvent(EventInterface $event): void
23
    {
24
        $this->anomalyHandling->createNewAnomalies();
25
    }
26
}
27