ExpectationCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 19
ccs 4
cts 4
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getIterator() 0 3 1
1
<?php
2
3
namespace CHStudio\Raven\Validator\Expectation;
4
5
use ArrayIterator;
6
use IteratorAggregate;
7
8
/**
9
 * @implements IteratorAggregate<int, ResponseExpectationInterface>
10
 */
11
class ExpectationCollection implements IteratorAggregate
12
{
13
    /**
14
     * @var ResponseExpectationInterface[]
15
     */
16
    private readonly array $expectations;
17
18 7
    public function __construct(
19
        ResponseExpectationInterface ...$expectations
20
    ) {
21 7
        $this->expectations = $expectations;
0 ignored issues
show
Bug introduced by
The property expectations is declared read-only in CHStudio\Raven\Validator...n\ExpectationCollection.
Loading history...
22
    }
23
24
    /**
25
     * @return ArrayIterator<int, ResponseExpectationInterface>
26
     */
27 5
    public function getIterator(): ArrayIterator
28
    {
29 5
        return new ArrayIterator($this->expectations);
30
    }
31
}
32