Passed
Push — master ( 200d88...9b81d7 )
by Alec
02:43 queued 15s
created

CustomPattern::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
// 09.03.23
5
6
namespace AlecRabbit\Spinner\Core\Pattern\Char;
7
8
use AlecRabbit\Spinner\Core\Pattern\A\AReversiblePattern;
9
use Traversable;
10
11
/** @psalm-suppress UnusedClass */
12
final class CustomPattern extends AReversiblePattern
13
{
14
    public function __construct(
15
        protected iterable $pattern,
16
        ?int $interval = null,
17
        bool $reversed = false
18
    ) {
19
        parent::__construct($interval, $reversed);
20
    }
21
22
    protected function pattern(): Traversable
23
    {
24
        yield from $this->pattern;
25
    }
26
}
27