NoCaptcha::getPostData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 12
nc 1
nop 0
dl 0
loc 13
rs 9.8666
c 0
b 0
f 0
1
<?php
2
namespace LaravelAnticaptcha\Anticaptcha;
3
4
class NoCaptcha extends Anticaptcha implements AntiCaptchaTaskProtocol {
5
6
    private $websiteUrl;
7
    private $websiteKey;
8
    private $websiteSToken;
9
    private $proxyType = "http";
10
    private $proxyAddress;
11
    private $proxyPort;
12
    private $proxyLogin;
13
    private $proxyPassword;
14
    private $userAgent = "";
15
    private $cookies = "";
16
    
17
    public function getPostData() {
18
        return array(
19
            "type"          =>  "NoCaptchaTask",
20
            "websiteURL"    =>  $this->websiteUrl,
21
            "websiteKey"    =>  $this->websiteKey,
22
            "websiteSToken" =>  $this->websiteSToken,
23
            "proxyType"     =>  $this->proxyType,
24
            "proxyAddress"  =>  $this->proxyAddress,
25
            "proxyPort"     =>  $this->proxyPort,
26
            "proxyLogin"    =>  $this->proxyLogin,
27
            "proxyPassword" =>  $this->proxyPassword,
28
            "userAgent"     =>  $this->userAgent,
29
            "cookies"       =>  $this->cookies
30
        );
31
    }
32
    
33
    public function setTaskInfo($taskInfo) {
34
        $this->taskInfo = $taskInfo;
35
    }
36
    
37
    public function getTaskSolution() {
38
        return $this->taskInfo->solution->gRecaptchaResponse;
39
    }
40
    
41
    public function setWebsiteURL($value) {
42
        $this->websiteUrl = $value;
43
    }
44
    
45
    public function setWebsiteKey($value) {
46
        $this->websiteKey = $value;
47
    }
48
    
49
    public function setWebsiteSToken($value) {
50
        $this->websiteSToken = $value;
51
    }
52
    
53
    public function setProxyType($value) {
54
        $this->proxyType = $value;
55
    }
56
    
57
    public function setProxyAddress($value) {
58
        $this->proxyAddress = $value;
59
    }
60
    
61
    public function setProxyPort($value) {
62
        $this->proxyPort = $value;
63
    }
64
    
65
    public function setProxyLogin($value) {
66
        $this->proxyLogin = $value;
67
    }
68
    
69
    public function setProxyPassword($value) {
70
        $this->proxyPassword = $value;
71
    }
72
    
73
    public function setUserAgent($value) {
74
        $this->userAgent = $value;
75
    }
76
    
77
    public function setCookies($value) {
78
        $this->cookies = $value;
79
    }
80
    
81
}
82