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

ProceduralFrameRevolverBuilder::build()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
c 0
b 0
f 0
nc 2
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
declare(strict_types=1);
4
// 20.03.23
5
namespace AlecRabbit\Spinner\Extras;
6
7
use AlecRabbit\Spinner\Contract\IProceduralPattern;
8
use AlecRabbit\Spinner\Core\A\AFrameRevolverBuilder;
9
use AlecRabbit\Spinner\Core\Revolver\Contract\IFrameRevolver;
10
use AlecRabbit\Spinner\Extras\Revolver\ProceduralRevolver;
11
12
final class ProceduralFrameRevolverBuilder extends AFrameRevolverBuilder
13
{
14
    public function build(): IFrameRevolver
15
    {
16
        self::assertPattern($this->pattern);
17
        if ($this->pattern instanceof IProceduralPattern) {
18
            return
19
                new ProceduralRevolver(
20
                    $this->pattern->getProcedure(),
0 ignored issues
show
Bug introduced by
The method getProcedure() does not exist on AlecRabbit\Spinner\Core\Pattern\Contract\IPattern. It seems like you code against a sub-type of AlecRabbit\Spinner\Core\Pattern\Contract\IPattern such as AlecRabbit\Spinner\Extra...AProceduralStylePattern or AlecRabbit\Spinner\Extra...re\A\AProceduralPattern or AlecRabbit\Spinner\Extra...AProceduralStylePattern. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
                    $this->pattern->/** @scrutinizer ignore-call */ 
21
                                    getProcedure(),
Loading history...
21
                    $this->pattern->getInterval()
22
                );
23
        }
24
        return parent::build();
25
    }
26
27
}