ExpectationFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 9 2
1
<?php
2
3
namespace CHStudio\Raven\Validator\Expectation;
4
5
class ExpectationFactory
6
{
7
    /**
8
     * @param array<string|int, string|array<string>> $data
9
     */
10 2
    public function fromArray(array $data): ExpectationCollection
11
    {
12 2
        $expectations = [];
13
14 2
        if (isset($data['statusCode'])) {
15 1
            $expectations[] = new StatusCode((int) $data['statusCode']);
16
        }
17
18 2
        return new ExpectationCollection(... $expectations);
19
    }
20
}
21