Passed
Push — master ( de3d61...be839c )
by Alec
13:42 queued 13s
created

StyleOptions::getIterator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
6
namespace AlecRabbit\Spinner\Extras\Color\Style;
7
8
use AlecRabbit\Spinner\Extras\Contract\Style\IStyleOptions;
9
use AlecRabbit\Spinner\Extras\Contract\Style\StyleOption;
10
use ArrayIterator;
11
use Traversable;
12
13
final class StyleOptions implements IStyleOptions
14
{
15
    private array $options;
16
17
    public function __construct(StyleOption ...$options)
18
    {
19
        $this->options = $options;
20
    }
21
22
    public function getIterator(): Traversable
23
    {
24
        return new ArrayIterator($this->options);
25
    }
26
27
    public function isEmpty(): bool
28
    {
29
        return count($this->options) === 0;
30
    }
31
}
32