Passed
Push — master ( 823aee...b9b37f )
by Alec
13:15 queued 12s
created

CustomStyle   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 18
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getColorMode() 0 3 1
A pattern() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
// 09.03.23
5
6
namespace AlecRabbit\Spinner\Core\Pattern\Style;
7
8
use AlecRabbit\Spinner\Contract\ColorMode;
9
use AlecRabbit\Spinner\Core\Pattern\Style\A\AStylePattern;
10
use Traversable;
11
12
/** @psalm-suppress UnusedClass */
13
final class CustomStyle extends AStylePattern
14
{
15
    public function __construct(
16
        protected iterable $pattern,
17
        ?int $interval = null,
18
        protected ColorMode $colorMode = self::COLOR_MODE,
19
    ) {
20
        parent::__construct($interval);
21
    }
22
23
    public function getColorMode(): ColorMode
24
    {
25
        return $this->colorMode;
26
    }
27
28
    protected function pattern(): Traversable
29
    {
30
        yield from $this->pattern;
31
    }
32
}
33