| Total Complexity | 4 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 10 | abstract class AbstractJuggler implements JugglerInterface |
||
| 11 | { |
||
| 12 | /** @var string */ |
||
| 13 | protected $spacer = Defaults::ONE_SPACE_SYMBOL; |
||
| 14 | |||
| 15 | /** @var int */ |
||
| 16 | protected $currentFrameErasingLength; |
||
| 17 | /** @var Circular */ |
||
| 18 | protected $style; |
||
| 19 | /** @var int */ |
||
| 20 | protected $formatErasingShift; |
||
| 21 | |||
| 22 | /** {@inheritDoc} */ |
||
| 23 | 23 | public function getFrameErasingLength(): int |
|
| 24 | { |
||
| 25 | 23 | return $this->currentFrameErasingLength; |
|
| 26 | } |
||
| 27 | |||
| 28 | /** {@inheritDoc} */ |
||
| 29 | 23 | public function getStyledFrame(): string |
|
| 30 | { |
||
| 31 | return |
||
| 32 | 23 | sprintf((string)$this->style->value(), $this->getCurrentFrame()) . $this->spacer; |
|
| 33 | } |
||
| 34 | |||
| 35 | |||
| 36 | /** |
||
| 37 | * @param string $format |
||
| 38 | * @return int |
||
| 39 | */ |
||
| 40 | 24 | protected function calcFormatErasingShift(string $format): int |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param Scott $style |
||
| 47 | */ |
||
| 48 | 24 | protected function init(Scott $style): void |
|
| 53 | 24 | } |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @return string |
||
| 57 | */ |
||
| 58 | abstract protected function getCurrentFrame():string; |
||
| 59 | } |
||
| 60 |