CustomCaptcha   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPostData() 0 6 1
A getTaskSolution() 0 2 1
A setAssignment() 0 2 1
A setForms() 0 7 2
A setImageUrl() 0 2 1
1
<?php
2
namespace LaravelAnticaptcha\Anticaptcha;
3
4
class CustomCaptcha extends Anticaptcha implements AntiCaptchaTaskProtocol {
5
6
    private $imageUrl;
7
    private $assignment;
8
    private $forms;
9
    
10
    public function getPostData() {
11
        return array(
12
            "type"              =>  "CustomCaptchaTask",
13
            "imageUrl"          =>  $this->imageUrl,
14
            "assignment"        =>  $this->assignment,
15
            "forms"             =>  $this->forms
16
        );
17
    }
18
    
19
    public function getTaskSolution() {
20
        return $this->taskInfo->solution->answers;
21
    }
22
    
23
    public function setImageUrl($value) {
24
        $this->imageUrl = $value;
25
    }
26
    
27
    public function setAssignment($value) {
28
        $this->assignment = $value;
29
    }
30
    
31
    public function setForms($value) {
32
        if (is_array($value)) {
33
            $this->forms = $value;
34
            return true;
35
        } else {
36
            $this->debout("form must be of type array", "red");
37
            return false;
38
        }
39
    }
40
    
41
}
42