MeasurableEventsFinder::execute()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
ccs 6
cts 6
cp 1
crap 2
rs 10
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