|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
|
|
6
|
|
|
namespace AlecRabbit\Spinner\Core\Settings; |
|
7
|
|
|
|
|
8
|
|
|
use AlecRabbit\Spinner\Contract\IFrame; |
|
9
|
|
|
use AlecRabbit\Spinner\Contract\Pattern\IPattern; |
|
10
|
|
|
use AlecRabbit\Spinner\Core\Pattern\Contract\IStylePattern; |
|
11
|
|
|
use AlecRabbit\Spinner\Core\Settings\Contract\IWidgetSettings; |
|
12
|
|
|
|
|
13
|
|
|
final class WidgetSettings implements IWidgetSettings |
|
14
|
|
|
{ |
|
15
|
|
|
public function __construct( |
|
16
|
|
|
protected IFrame $leadingSpacer, |
|
17
|
|
|
protected IFrame $trailingSpacer, |
|
18
|
|
|
protected IStylePattern $stylePattern, |
|
19
|
|
|
protected IPattern $charPattern, |
|
20
|
|
|
) { |
|
21
|
|
|
} |
|
22
|
|
|
|
|
23
|
|
|
public function getLeadingSpacer(): IFrame |
|
24
|
|
|
{ |
|
25
|
|
|
return $this->leadingSpacer; |
|
26
|
|
|
} |
|
27
|
|
|
|
|
28
|
|
|
public function setLeadingSpacer(IFrame $frame): IWidgetSettings |
|
29
|
|
|
{ |
|
30
|
|
|
$this->leadingSpacer = $frame; |
|
31
|
|
|
return $this; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
public function getTrailingSpacer(): IFrame |
|
35
|
|
|
{ |
|
36
|
|
|
return $this->trailingSpacer; |
|
37
|
|
|
} |
|
38
|
|
|
|
|
39
|
|
|
public function setTrailingSpacer(IFrame $frame): IWidgetSettings |
|
40
|
|
|
{ |
|
41
|
|
|
$this->trailingSpacer = $frame; |
|
42
|
|
|
return $this; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public function getStylePattern(): IStylePattern |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->stylePattern; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function setStylePattern(IStylePattern $pattern): IWidgetSettings |
|
51
|
|
|
{ |
|
52
|
|
|
$this->stylePattern = $pattern; |
|
53
|
|
|
return $this; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function getCharPattern(): IPattern |
|
57
|
|
|
{ |
|
58
|
|
|
return $this->charPattern; |
|
59
|
|
|
} |
|
60
|
|
|
|
|
61
|
|
|
public function setCharPattern(IPattern $pattern): IWidgetSettings |
|
62
|
|
|
{ |
|
63
|
|
|
$this->charPattern = $pattern; |
|
64
|
|
|
return $this; |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|