SymbolIterator::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
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