Passed
Push — master ( 7b0af7...e2bdc6 )
by Alec
03:09
created

AbstractJuggler::getStyledFrame()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Spinner\Core\Jugglers;
4
5
use AlecRabbit\Accessories\Circular;
6
use AlecRabbit\Spinner\Core\Jugglers\Contracts\JugglerInterface;
7
use AlecRabbit\Spinner\Settings\Contracts\Defaults;
8
9
abstract class AbstractJuggler implements JugglerInterface
10
{
11
    /** @var int */
12
    protected $currentFrameErasingLength;
13
    /** @var Circular */
14
    protected $style;
15
    /** @var string */
16
    protected $prefix = Defaults::EMPTY_STRING;
17
    /** @var string */
18
    protected $suffix = Defaults::EMPTY_STRING;
19
20
    /** {@inheritDoc} */
21 23
    public function getFrameErasingLength(): int
22
    {
23 23
        return $this->currentFrameErasingLength;
24
    }
25
26
    /** {@inheritDoc} */
27 23
    public function getStyledFrame(): string
28
    {
29
        return
30 23
            sprintf((string)$this->style->value(), $this->getCurrentFrame());
31
    }
32
33
    abstract protected function getCurrentFrame():string;
34
}
35