ConfigIterator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A current() 0 8 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PublishingKit\Config;
6
7
use ArrayIterator;
8
9
final class ConfigIterator extends ArrayIterator
10
{
11 3
    /**
12
     * @return Config|scalar
13 3
     */
14 3
    public function current()
15 3
    {
16
        /** @var array<array-key, array|scalar>|scalar **/
17 3
        $result = parent::current();
18
        if (is_array($result)) {
19
            return new Config($result);
20 2
        }
21
        return $result;
22
    }
23
}
24