Recipients::getIterator()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Notifier\Recipient;
6
7
use ArrayIterator;
8
use IteratorAggregate;
9
use Traversable;
10
11
class Recipients implements IteratorAggregate
12
{
13
    /** @var Recipient[] */
14
    private $recipients;
15
16 3
    final public function __construct(Recipient ...$recipients)
17
    {
18 3
        $this->recipients = $recipients;
19 3
    }
20
21
    /**
22
     * @return Traversable|Recipient[]
23
     */
24 2
    public function getIterator()
25
    {
26 2
        return new ArrayIterator($this->recipients);
27
    }
28
}
29