Passed
Push — master ( 205488...e43c9f )
by Rustam
01:47
created

CompositePresenter::present()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 3.1852

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 4
ccs 1
cts 3
cp 0.3333
crap 3.1852
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RustamWin\Attributes\Presenter;
6
7
use Generator;
8
use ReflectionClass;
9
10
final class CompositePresenter implements AttributePresenterInterface
11
{
12
    /**
13
     * @param AttributePresenterInterface[] $presenters
14
     */
15 1
    public function __construct(private array $presenters)
16
    {
17 1
    }
18
19
    /**
20
     * @inheritDoc
21
     */
22 1
    public function present(ReflectionClass $class, array $attributes): Generator
23
    {
24
        foreach ($this->presenters as $presenter) {
25
            yield $presenter->present($class, $attributes);
26
        }
27
    }
28
}
29