1 | <?php |
||
29 | class Captcha |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * @var Filesystem |
||
34 | */ |
||
35 | protected $files; |
||
36 | |||
37 | /** |
||
38 | * @var Repository |
||
39 | */ |
||
40 | protected $config; |
||
41 | |||
42 | /** |
||
43 | * @var ImageManager |
||
44 | */ |
||
45 | protected $imageManager; |
||
46 | |||
47 | /** |
||
48 | * @var Session |
||
49 | */ |
||
50 | protected $session; |
||
51 | |||
52 | /** |
||
53 | * @var Hasher |
||
54 | */ |
||
55 | protected $hasher; |
||
56 | |||
57 | /** |
||
58 | * @var Str |
||
59 | */ |
||
60 | protected $str; |
||
61 | |||
62 | /** |
||
63 | * @var ImageManager->canvas |
||
64 | */ |
||
65 | protected $canvas; |
||
66 | |||
67 | /** |
||
68 | * @var ImageManager->image |
||
69 | */ |
||
70 | protected $image; |
||
71 | |||
72 | /** |
||
73 | * @var array |
||
74 | */ |
||
75 | protected $backgrounds = []; |
||
76 | |||
77 | /** |
||
78 | * @var array |
||
79 | */ |
||
80 | protected $fonts = []; |
||
81 | |||
82 | /** |
||
83 | * @var array |
||
84 | */ |
||
85 | protected $fontColors = []; |
||
86 | |||
87 | /** |
||
88 | * @var int |
||
89 | */ |
||
90 | protected $length = 5; |
||
91 | |||
92 | /** |
||
93 | * @var int |
||
94 | */ |
||
95 | protected $width = 120; |
||
96 | |||
97 | /** |
||
98 | * @var int |
||
99 | */ |
||
100 | protected $height = 36; |
||
101 | |||
102 | /** |
||
103 | * @var int |
||
104 | */ |
||
105 | protected $angle = 15; |
||
106 | |||
107 | /** |
||
108 | * @var int |
||
109 | */ |
||
110 | protected $lines = 3; |
||
111 | |||
112 | /** |
||
113 | * @var string |
||
114 | */ |
||
115 | protected $characters; |
||
116 | |||
117 | /** |
||
118 | * @var string |
||
119 | */ |
||
120 | protected $text; |
||
121 | |||
122 | /** |
||
123 | * @var int |
||
124 | */ |
||
125 | protected $contrast = 0; |
||
126 | |||
127 | /** |
||
128 | * @var int |
||
129 | */ |
||
130 | protected $quality = 90; |
||
131 | |||
132 | /** |
||
133 | * @var int |
||
134 | */ |
||
135 | protected $sharpen = 0; |
||
136 | |||
137 | /** |
||
138 | * @var int |
||
139 | */ |
||
140 | protected $blur = 0; |
||
141 | |||
142 | /** |
||
143 | * @var bool |
||
144 | */ |
||
145 | protected $bgImage = true; |
||
146 | |||
147 | /** |
||
148 | * @var string |
||
149 | */ |
||
150 | protected $bgColor = '#ffffff'; |
||
151 | |||
152 | /** |
||
153 | * @var bool |
||
154 | */ |
||
155 | protected $invert = false; |
||
156 | |||
157 | /** |
||
158 | * @var bool |
||
159 | */ |
||
160 | protected $sensitive = false; |
||
161 | |||
162 | /** |
||
163 | * @var int |
||
164 | */ |
||
165 | protected $textLeftPadding = 4; |
||
166 | |||
167 | /** |
||
168 | * Constructor |
||
169 | * |
||
170 | * @param Filesystem $files |
||
171 | * @param Repository $config |
||
172 | * @param ImageManager $imageManager |
||
173 | * @param Session $session |
||
174 | * @param Hasher $hasher |
||
175 | * @param Str $str |
||
176 | * @throws Exception |
||
177 | * @internal param Validator $validator |
||
178 | */ |
||
179 | public function __construct( |
||
196 | |||
197 | /** |
||
198 | * @param string $config |
||
199 | * @return void |
||
200 | */ |
||
201 | protected function configure($config) |
||
211 | |||
212 | /** |
||
213 | * Create captcha image |
||
214 | * |
||
215 | * @param string $config |
||
216 | * @return ImageManager->response |
||
|
|||
217 | */ |
||
218 | public function create($config = 'default') |
||
278 | |||
279 | /** |
||
280 | * Image backgrounds |
||
281 | * |
||
282 | * @return string |
||
283 | */ |
||
284 | protected function background() |
||
288 | |||
289 | /** |
||
290 | * Generate captcha text |
||
291 | * |
||
292 | * @return string |
||
293 | */ |
||
294 | protected function generate() |
||
311 | |||
312 | /** |
||
313 | * Writing captcha text |
||
314 | */ |
||
315 | protected function text() |
||
336 | |||
337 | /** |
||
338 | * Image fonts |
||
339 | * |
||
340 | * @return string |
||
341 | */ |
||
342 | protected function font() |
||
346 | |||
347 | /** |
||
348 | * Random font size |
||
349 | * |
||
350 | * @return integer |
||
351 | */ |
||
352 | protected function fontSize() |
||
356 | |||
357 | /** |
||
358 | * Random font color |
||
359 | * |
||
360 | * @return array |
||
361 | */ |
||
362 | protected function fontColor() |
||
375 | |||
376 | /** |
||
377 | * Angle |
||
378 | * |
||
379 | * @return int |
||
380 | */ |
||
381 | protected function angle() |
||
385 | |||
386 | /** |
||
387 | * Random image lines |
||
388 | * |
||
389 | * @return \Intervention\Image\Image |
||
390 | */ |
||
391 | protected function lines() |
||
407 | |||
408 | /** |
||
409 | * Captcha check |
||
410 | * |
||
411 | * @param $value |
||
412 | * @return bool |
||
413 | */ |
||
414 | public function check($value) |
||
432 | |||
433 | /** |
||
434 | * Generate captcha image source |
||
435 | * |
||
436 | * @param null $config |
||
437 | * @return string |
||
438 | */ |
||
439 | public function src($config = null) |
||
443 | |||
444 | /** |
||
445 | * Generate captcha image html tag |
||
446 | * |
||
447 | * @param null $config |
||
448 | * @param array $attrs HTML attributes supplied to the image tag where key is the attribute |
||
449 | * and the value is the attribute value |
||
450 | * @return string |
||
451 | */ |
||
452 | public function img($config = null, $attrs = []) |
||
464 | |||
465 | } |
||
466 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.