| Total Complexity | 5 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | abstract class SpinnerCore implements SpinnerInterface |
||
| 14 | { |
||
| 15 | protected const EMPTY_STRING = Defaults::EMPTY_STRING; |
||
| 16 | |||
| 17 | protected const INTERVAL = Defaults::DEFAULT_INTERVAL; |
||
| 18 | protected const FRAMES = Frames::BASE; |
||
| 19 | protected const STYLES = Styles::STYLING_DISABLED; |
||
| 20 | |||
| 21 | /** @var null|OutputInterface */ |
||
| 22 | protected $output; |
||
| 23 | /** @var bool */ |
||
| 24 | protected $enabled; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param null|false|OutputInterface $output |
||
| 28 | * @return null|OutputInterface |
||
| 29 | */ |
||
| 30 | 29 | protected function refineOutput($output): ?OutputInterface |
|
| 31 | { |
||
| 32 | 29 | Sentinel::assertOutput($output); |
|
| 33 | 27 | if (false === $output) { |
|
| 34 | 23 | return null; |
|
| 35 | } |
||
| 36 | 4 | return $output ?? new EchoOutputAdapter(); |
|
| 37 | } |
||
| 38 | |||
| 39 | /** {@inheritDoc} */ |
||
| 40 | 1 | public function disable(): SpinnerInterface |
|
| 44 | } |
||
| 45 | |||
| 46 | /** {@inheritDoc} */ |
||
| 47 | 1 | public function enable(): SpinnerInterface |
|
| 51 | } |
||
| 52 | |||
| 53 | /** {@inheritDoc} */ |
||
| 54 | 1 | public function isActive(): bool |
|
| 59 |