CustomCaptcha::setForms()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 2
nop 1
dl 0
loc 7
rs 10
c 0
b 0
f 0
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