| Total Complexity | 4 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 12 | class Style |
||
| 13 | { |
||
| 14 | /** @var Circular */ |
||
| 15 | protected $symbolStyles; |
||
| 16 | /** @var Circular */ |
||
| 17 | protected $messageStyles; |
||
| 18 | /** @var Circular */ |
||
| 19 | protected $percentStyles; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Styles constructor. |
||
| 23 | * @param array $styles |
||
| 24 | * @param mixed $color |
||
| 25 | */ |
||
| 26 | 11 | public function __construct(array $styles, $color = null) |
|
| 27 | { |
||
| 28 | 11 | $prototype = new Prototype($styles, $color); |
|
| 29 | 11 | $this->symbolStyles = $prototype->getSpinnerStyles(); |
|
| 30 | 11 | $this->messageStyles = $prototype->getMessageStyles(); |
|
| 31 | 11 | $this->percentStyles = $prototype->getPercentStyles(); |
|
| 32 | 11 | } |
|
| 33 | |||
| 34 | 10 | public function spinner(string $symbol): string |
|
| 37 | } |
||
| 38 | |||
| 39 | 10 | public function message(string $message): string |
|
| 40 | { |
||
| 41 | return |
||
| 42 | 10 | sprintf( |
|
| 43 | 10 | (string)$this->messageStyles->value(), |
|
| 44 | 10 | $message |
|
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | 10 | public function percent(string $percent): string |
|
| 54 | ); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |