MeasurableEventsFinder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A execute() 0 7 2
1
<?php
2
3
namespace ZoiloMora\ElasticAPM\Processor\MetricSetProcessor;
4
5
use ZoiloMora\ElasticAPM\Events\Event;
6
use ZoiloMora\ElasticAPM\Events\Span\Span as SpanEvent;
7
use ZoiloMora\ElasticAPM\Events\Transaction\Transaction as TransactionEvent;
8
9
final class MeasurableEventsFinder
10
{
11
    /**
12
     * @param Event[] $events
13
     *
14
     * @return Event[]
15
     */
16 1
    public function execute(array $events)
17
    {
18 1
        return array_values(
19 1
            array_filter(
20 1
                $events,
21 1
                static function ($event) {
22 1
                    return true === $event instanceof TransactionEvent || true === $event instanceof SpanEvent;
23
                }
24 1
            )
25 1
        );
26
    }
27
}
28