HistoryLevelActivity   A
last analyzed

Complexity

Total Complexity 21

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 21
eloc 22
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
D isHistoryEventProduced() 0 25 19
A getId() 0 3 1
1
<?php
2
3
namespace Jabe\Impl\History;
4
5
use Jabe\ProcessEngineConfiguration;
6
use Jabe\Impl\History\Event\{
7
    HistoryEventTypeInterface,
8
    HistoryEventTypes
9
};
10
11
class HistoryLevelActivity extends AbstractHistoryLevel
12
{
13
    public function getId(): int
14
    {
15
        return 1;
16
    }
17
18
    public function getName(): string
19
    {
20
        return ProcessEngineConfiguration::HISTORY_ACTIVITY;
21
    }
22
23
    public function isHistoryEventProduced(HistoryEventTypeInterface $eventType, $entity): bool
24
    {
25
        return HistoryEventTypes::processInstanceStart()->equals($eventType)
0 ignored issues
show
Bug introduced by
The method equals() does not exist on Jabe\Impl\History\Event\HistoryEventTypeInterface. Since it exists in all sub-types, consider adding an abstract or default implementation to Jabe\Impl\History\Event\HistoryEventTypeInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

25
        return HistoryEventTypes::processInstanceStart()->/** @scrutinizer ignore-call */ equals($eventType)
Loading history...
26
        || HistoryEventTypes::processInstanceUpdate()->equals($eventType)
27
        || HistoryEventTypes::processInstanceMigrate()->equals($eventType)
28
        || HistoryEventTypes::processInstanceEnd()->equals($eventType)
29
30
        || HistoryEventTypes::taskInstanceCreate()->equals($eventType)
31
        || HistoryEventTypes::taskInstanceUpdate()->equals($eventType)
32
        || HistoryEventTypes::taskInstanceMigrate()->equals($eventType)
33
        || HistoryEventTypes::taskInstanceComplete()->equals($eventType)
34
        || HistoryEventTypes::taskInstanceDelete()->equals($eventType)
35
36
        || HistoryEventTypes::activityInstanceStart()->equals($eventType)
37
        || HistoryEventTypes::activityInstanceUpdate()->equals($eventType)
38
        || HistoryEventTypes::activityInstanceMigrate()->equals($eventType)
39
        || HistoryEventTypes::activityInstanceEnd()->equals($eventType)
40
41
        || HistoryEventTypes::caseInstanceCreate()->equals($eventType)
42
        || HistoryEventTypes::caseInstanceUpdate()->equals($eventType)
43
        || HistoryEventTypes::caseInstanceClose()->equals($eventType)
44
45
        || HistoryEventTypes::caseActivityInstanceCreate()->equals($eventType)
46
        || HistoryEventTypes::caseActivityInstanceUpdate()->equals($eventType)
47
        || HistoryEventTypes::caseActivityInstanceEnd()->equals($eventType);
48
    }
49
}
50