Passed
Push — master ( d4876d...130a7d )
by Zoilo
02:27 queued 15s
created

MeasurableEventsFinder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 14
ccs 0
cts 6
cp 0
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
    public function execute(array $events)
17
    {
18
        return array_values(
19
            array_filter(
20
                $events,
21
                static function ($event) {
22
                    return true === $event instanceof TransactionEvent || true === $event instanceof SpanEvent;
23
                }
24
            )
25
        );
26
    }
27
}
28