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

StyleOptions   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 17
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A isEmpty() 0 3 1
A getIterator() 0 3 1
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