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

TmpProceduralCharPattern   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
c 0
b 0
f 0
dl 0
loc 14
rs 10
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hp$0 ➔ update() 0 6 2
getProcedure() 0 10 ?
A hp$0 ➔ getProcedure() 0 10 2
1
<?php
2
3
declare(strict_types=1);
4
// 09.03.23
5
6
namespace AlecRabbit\Spinner\Extras\Procedure;
7
8
use AlecRabbit\Spinner\Contract\IFrame;
9
use AlecRabbit\Spinner\Contract\IProcedure;
10
use AlecRabbit\Spinner\Core\Factory\FrameFactory;
11
use AlecRabbit\Spinner\Extras\Procedure\A\AProceduralPattern;
12
use AlecRabbit\Spinner\Extras\Procedure\A\AProcedure;
13
14
/**
15
 * TODO Needed for development purposes only.
16
 */
17
final class TmpProceduralCharPattern extends AProceduralPattern
18
{
19
    protected const UPDATE_INTERVAL = 500;
20
21
    public function getProcedure(): IProcedure
22
    {
23
        return
24
            new class () extends AProcedure {
25
                public function update(float $dt = null): IFrame
26
                {
27
                    static $odd = true;
28
                    $odd = !$odd;
29
                    return
30
                        FrameFactory::create($odd ? '⢸' : '⡇', 1);
31
                }
32
            };
33
    }
34
}
35