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 FontSizeGeneratorInterface */ |
||
33 | protected $sizeGenerator; |
||
34 | /** @var string */ |
||
35 | protected $placerName; |
||
36 | /** @var int */ |
||
37 | protected $minFontSize = 10; |
||
38 | /** @var int */ |
||
39 | protected $maxFontSize = 60; |
||
40 | /** @var FontsFactory */ |
||
41 | protected $fontsFactory; |
||
42 | /** @var bool */ |
||
43 | protected $precise = false; |
||
44 | /** @var MaskInterface */ |
||
45 | protected $mask; |
||
46 | |||
47 | /** |
||
48 | * @param FontsFactory $fontsFactory |
||
49 | */ |
||
50 | 4 | protected function __construct(FontsFactory $fontsFactory) |
|
54 | |||
55 | /** |
||
56 | * @param \SixtyNine\Cloud\Factory\FontsFactory $fontsFactory |
||
57 | * @return CloudBuilder |
||
58 | */ |
||
59 | 4 | public static function create(FontsFactory $fontsFactory) |
|
63 | |||
64 | /** |
||
65 | * @param int $width |
||
66 | * @param int $height |
||
67 | * @return CloudBuilder |
||
68 | */ |
||
69 | 2 | public function setDimension($width, $height) |
|
75 | |||
76 | /** |
||
77 | * @param string $color |
||
78 | * @return $this |
||
79 | */ |
||
80 | 2 | public function setBackgroundColor($color) |
|
85 | |||
86 | /** |
||
87 | * @param string $name |
||
88 | * @return $this |
||
89 | */ |
||
90 | 4 | public function setFont($name) |
|
95 | |||
96 | /** |
||
97 | * @param FontSizeGeneratorInterface $generator |
||
98 | * @return $this |
||
99 | */ |
||
100 | public function setSizeGenerator(FontSizeGeneratorInterface $generator) |
||
105 | |||
106 | /** |
||
107 | * @param int $minSize |
||
108 | * @param int $maxSize |
||
109 | * @return $this |
||
110 | */ |
||
111 | public function setFontSizes($minSize, $maxSize) |
||
117 | |||
118 | /** |
||
119 | * @param string $name |
||
120 | * @return $this |
||
121 | */ |
||
122 | 1 | public function setPlacer($name) |
|
128 | |||
129 | /** |
||
130 | * @return $this |
||
131 | */ |
||
132 | public function setPrecise() |
||
137 | |||
138 | /** |
||
139 | * @param WordsList $list |
||
140 | * @return $this |
||
141 | */ |
||
142 | 3 | public function useList(WordsList $list) |
|
147 | |||
148 | /** |
||
149 | * @return Cloud |
||
150 | */ |
||
151 | 4 | public function build() |
|
170 | |||
171 | /** |
||
172 | * @param Cloud $cloud |
||
173 | * @param WordsList $list |
||
174 | * @return $this |
||
175 | */ |
||
176 | 3 | protected function addWords(Cloud $cloud, WordsList $list) |
|
202 | |||
203 | /** |
||
204 | * @param Cloud $cloud |
||
205 | * @return \SixtyNine\Cloud\Usher\Usher |
||
206 | */ |
||
207 | 3 | protected function placeWords(Cloud $cloud) |
|
232 | |||
233 | /** |
||
234 | * @return MaskInterface |
||
235 | */ |
||
236 | public function getMask() |
||
240 | } |
||
241 |