ByParentIdFinder   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
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 15
ccs 6
cts 6
cp 1
rs 10
wmc 1

1 Method

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