|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace AlecRabbit\Spinner\Core\Widget; |
|
6
|
|
|
|
|
7
|
|
|
use AlecRabbit\Spinner\Contract\IFrame; |
|
8
|
|
|
use AlecRabbit\Spinner\Core\CharFrame; |
|
|
|
|
|
|
9
|
|
|
use AlecRabbit\Spinner\Core\Contract\ICharFrame; |
|
10
|
|
|
use AlecRabbit\Spinner\Core\Contract\IIntervalComparator; |
|
11
|
|
|
use AlecRabbit\Spinner\Core\Contract\ITolerance; |
|
12
|
|
|
use AlecRabbit\Spinner\Core\IntervalComparator; |
|
|
|
|
|
|
13
|
|
|
use AlecRabbit\Spinner\Core\Revolver\A\ARevolver; |
|
14
|
|
|
use AlecRabbit\Spinner\Core\Revolver\Contract\IRevolver; |
|
15
|
|
|
use AlecRabbit\Spinner\Core\Widget\Contract\IWidgetRevolver; |
|
16
|
|
|
use AlecRabbit\Spinner\Exception\LogicException; |
|
17
|
|
|
|
|
18
|
|
|
final class WidgetRevolver extends ARevolver implements IWidgetRevolver |
|
19
|
|
|
{ |
|
20
|
|
|
public function __construct( |
|
21
|
|
|
private readonly IRevolver $style, |
|
22
|
|
|
private readonly IRevolver $character, |
|
23
|
|
|
ITolerance $tolerance, |
|
24
|
|
|
IIntervalComparator $intervalComparator = new IntervalComparator( |
|
25
|
|
|
), // FIXME (2023-11-21 17:34) [Alec Rabbit]: pass it as param it or better pass IInterval |
|
26
|
|
|
) |
|
27
|
|
|
{ |
|
28
|
|
|
parent::__construct( |
|
29
|
|
|
$intervalComparator->smallest( |
|
30
|
|
|
$style->getInterval(), |
|
31
|
|
|
$character->getInterval(), |
|
32
|
|
|
), |
|
33
|
|
|
$tolerance, |
|
34
|
|
|
); |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function getFrame(?float $dt = null): IFrame |
|
38
|
|
|
{ |
|
39
|
|
|
$style = $this->style->getFrame($dt); |
|
40
|
|
|
$char = $this->character->getFrame($dt); |
|
41
|
|
|
return $this->createFrame( |
|
42
|
|
|
sprintf($style->getSequence(), $char->getSequence()), |
|
43
|
|
|
$style->getWidth() + $char->getWidth() |
|
44
|
|
|
); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
|
private function createFrame(string $sequence, int $width): ICharFrame |
|
48
|
|
|
{ |
|
49
|
|
|
return new CharFrame($sequence, $width); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
// @codeCoverageIgnoreStart |
|
53
|
|
|
protected function next(?float $dt = null): void |
|
54
|
|
|
{ |
|
55
|
|
|
throw new LogicException( |
|
56
|
|
|
sprintf( |
|
57
|
|
|
'Method %s() should never be called.', |
|
58
|
|
|
__METHOD__ |
|
59
|
|
|
) |
|
60
|
|
|
); |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
protected function current(): IFrame |
|
64
|
|
|
{ |
|
65
|
|
|
throw new LogicException( |
|
66
|
|
|
sprintf( |
|
67
|
|
|
'Method %s() should never be called.', |
|
68
|
|
|
__METHOD__ |
|
69
|
|
|
) |
|
70
|
|
|
); |
|
71
|
|
|
} |
|
72
|
|
|
// @codeCoverageIgnoreEnd |
|
73
|
|
|
} |
|
74
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths