1 | <?php |
||
20 | class CloudBuilder |
||
21 | { |
||
22 | /** @var WordsList */ |
||
23 | protected $list; |
||
24 | /** @var int */ |
||
25 | protected $width = 800; |
||
26 | /** @var int */ |
||
27 | protected $height = 600; |
||
28 | /** @var string */ |
||
29 | protected $font; |
||
30 | /** @var string */ |
||
31 | protected $backgroundColor = '#ffffff'; |
||
32 | /** @var int */ |
||
33 | protected $backgroundOpacity = 100; |
||
34 | /** @var FontSizeGeneratorInterface */ |
||
35 | protected $sizeGenerator; |
||
36 | /** @var string */ |
||
37 | protected $placerName; |
||
38 | /** @var int */ |
||
39 | protected $minFontSize = 10; |
||
40 | /** @var int */ |
||
41 | protected $maxFontSize = 60; |
||
42 | /** @var FontsFactory */ |
||
43 | protected $fontsFactory; |
||
44 | /** @var bool */ |
||
45 | protected $precise = false; |
||
46 | /** @var MaskInterface */ |
||
47 | protected $mask; |
||
48 | |||
49 | /** |
||
50 | * @param FontsFactory $fontsFactory |
||
51 | */ |
||
52 | 4 | protected function __construct(FontsFactory $fontsFactory) |
|
56 | |||
57 | /** |
||
58 | * @param \SixtyNine\Cloud\Factory\FontsFactory $fontsFactory |
||
59 | * @return CloudBuilder |
||
60 | */ |
||
61 | 4 | public static function create(FontsFactory $fontsFactory) |
|
65 | |||
66 | /** |
||
67 | * @param int $width |
||
68 | * @param int $height |
||
69 | * @return CloudBuilder |
||
70 | */ |
||
71 | 2 | public function setDimension($width, $height) |
|
77 | |||
78 | /** |
||
79 | * @param string $color |
||
80 | * @return $this |
||
81 | */ |
||
82 | 2 | public function setBackgroundColor($color) |
|
87 | |||
88 | /** |
||
89 | * @param int $opacity |
||
90 | * @return $this |
||
91 | */ |
||
92 | public function setBackgroundOpacity($opacity) |
||
97 | |||
98 | /** |
||
99 | * @param string $name |
||
100 | * @return $this |
||
101 | */ |
||
102 | 4 | public function setFont($name) |
|
107 | |||
108 | /** |
||
109 | * @param FontSizeGeneratorInterface $generator |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function setSizeGenerator(FontSizeGeneratorInterface $generator) |
||
117 | |||
118 | /** |
||
119 | * @param int $minSize |
||
120 | * @param int $maxSize |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function setFontSizes($minSize, $maxSize) |
||
129 | |||
130 | /** |
||
131 | * @param string $name |
||
132 | * @return $this |
||
133 | */ |
||
134 | 1 | public function setPlacer($name) |
|
140 | |||
141 | /** |
||
142 | * @return $this |
||
143 | */ |
||
144 | public function setPrecise() |
||
149 | |||
150 | /** |
||
151 | * @param WordsList $list |
||
152 | * @return $this |
||
153 | */ |
||
154 | 3 | public function useList(WordsList $list) |
|
159 | |||
160 | /** |
||
161 | * @return Cloud |
||
162 | */ |
||
163 | 4 | public function build() |
|
183 | |||
184 | /** |
||
185 | * @param Cloud $cloud |
||
186 | * @param WordsList $list |
||
187 | * @return $this |
||
188 | */ |
||
189 | 3 | protected function addWords(Cloud $cloud, WordsList $list) |
|
220 | 3 | ||
221 | /** |
||
222 | 3 | * @param Cloud $cloud |
|
223 | 1 | * @return \SixtyNine\Cloud\Usher\Usher |
|
224 | 3 | */ |
|
225 | protected function placeWords(Cloud $cloud) |
||
250 | |||
251 | /** |
||
252 | * @return MaskInterface |
||
253 | */ |
||
254 | public function getMask() |
||
258 | } |
||
259 |