SymbolIterator   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A jsonSerialize() 0 3 1
A current() 0 3 1
A __construct() 0 4 1
1
<?php
2
/**
3
 * Copyright MediaCT. All rights reserved.
4
 * https://www.mediact.nl
5
 */
6
7
namespace Mediact\DependencyGuard\Php;
8
9
use ArrayIterator;
10
use IteratorIterator;
11
12
class SymbolIterator extends IteratorIterator implements SymbolIteratorInterface
13
{
14
    /**
15
     * Constructor.
16
     *
17
     * @param SymbolInterface ...$symbols
18
     */
19 3
    public function __construct(SymbolInterface ...$symbols)
20
    {
21 3
        parent::__construct(
22 3
            new ArrayIterator($symbols)
23
        );
24 3
    }
25
26
    /**
27
     * Get the current symbol.
28
     *
29
     * @return SymbolInterface
30
     */
31 2
    public function current(): SymbolInterface
32
    {
33 2
        return parent::current();
34
    }
35
36
    /**
37
     * Specify data that should be serialized to JSON.
38
     *
39
     * @return array
40
     */
41 3
    public function jsonSerialize(): array
42
    {
43 3
        return iterator_to_array($this);
44
    }
45
}
46