This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace juniorb2ss\DeathByCaptcha; |
||
4 | |||
5 | use GuzzleHttp\Client as GuzzleClient; |
||
6 | use GuzzleHttp\ClientInterface; |
||
7 | use GuzzleHttp\Psr7\Response; |
||
8 | use juniorb2ss\DeathByCaptcha\Abstracts\HttpDeathByCaptchaAbstract; |
||
9 | use juniorb2ss\DeathByCaptcha\Interfaces\AccountInterface; |
||
10 | use juniorb2ss\DeathByCaptcha\Interfaces\DeathByCaptchaInterface; |
||
11 | use juniorb2ss\DeathByCaptcha\Interfaces\ReportInterface; |
||
12 | use juniorb2ss\DeathByCaptcha\Interfaces\ResolveInterface; |
||
13 | use juniorb2ss\DeathByCaptcha\Interfaces\StatusInterface; |
||
14 | use juniorb2ss\DeathByCaptcha\Services\AccountService; |
||
15 | use juniorb2ss\DeathByCaptcha\Services\ImageService; |
||
16 | use juniorb2ss\DeathByCaptcha\Services\ReportService; |
||
17 | use juniorb2ss\DeathByCaptcha\Services\ResolveService; |
||
18 | use juniorb2ss\DeathByCaptcha\Services\StatusService; |
||
19 | |||
20 | class DeathByCaptcha extends HttpDeathByCaptchaAbstract implements DeathByCaptchaInterface |
||
21 | { |
||
22 | /** |
||
23 | * URL do serviço |
||
24 | */ |
||
25 | const API_URL = 'http://api.dbcapi.me/api/'; |
||
26 | |||
27 | /** |
||
28 | * API Version |
||
29 | */ |
||
30 | const API_VERSION = 'DBC/PHP v5'; |
||
31 | |||
32 | /** |
||
33 | * Request DEFAULT TIMEOUT |
||
34 | */ |
||
35 | const DEFAULT_TIMEOUT = 60; |
||
36 | |||
37 | /** |
||
38 | * @param string $username |
||
39 | * @param string $password |
||
40 | * @param ClientInterface|null $client |
||
0 ignored issues
–
show
|
|||
41 | * @param AccountInterface|null $account |
||
0 ignored issues
–
show
There is no parameter named
$account . Was it maybe removed?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. Consider the following example. The parameter /**
* @param array $germany
* @param array $island
* @param array $italy
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was removed, but the annotation was not. ![]() |
|||
42 | * @param StatusInterface|null $status |
||
0 ignored issues
–
show
There is no parameter named
$status . Was it maybe removed?
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. Consider the following example. The parameter /**
* @param array $germany
* @param array $island
* @param array $italy
*/
function finale($germany, $island) {
return "2:1";
}
The most likely cause is that the parameter was removed, but the annotation was not. ![]() |
|||
43 | */ |
||
44 | 81 | public function __construct( |
|
45 | string $username, |
||
46 | string $password |
||
47 | ) { |
||
48 | 81 | $this->username = $username; |
|
0 ignored issues
–
show
The property
username does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
49 | 81 | $this->password = $password; |
|
0 ignored issues
–
show
The property
password does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
50 | |||
51 | 81 | $this->client = new GuzzleClient; |
|
0 ignored issues
–
show
The property
client does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
52 | 81 | $this->account = new AccountService; |
|
0 ignored issues
–
show
The property
account does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
53 | 81 | $this->status = new StatusService; |
|
0 ignored issues
–
show
The property
status does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
54 | 81 | $this->report = new ReportService; |
|
0 ignored issues
–
show
The property
report does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
55 | 81 | $this->resolve = new ResolveService; |
|
0 ignored issues
–
show
The property
resolve does not exist. Did you maybe forget to declare it?
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code: class MyClass { }
$x = new MyClass();
$x->foo = true;
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: class MyClass {
public $foo;
}
$x = new MyClass();
$x->foo = true;
![]() |
|||
56 | 81 | } |
|
57 | |||
58 | 81 | public function setHttpClient(ClientInterface $client) |
|
59 | { |
||
60 | 81 | $this->client = $client; |
|
61 | |||
62 | 81 | return $this; |
|
63 | } |
||
64 | |||
65 | 39 | public function account(): AccountInterface |
|
66 | { |
||
67 | 39 | $response = $this->accountRequest(); |
|
68 | |||
69 | 24 | return $this->account |
|
70 | 24 | ->setResponse($response); |
|
71 | } |
||
72 | |||
73 | 18 | public function status(): StatusInterface |
|
74 | { |
||
75 | 18 | $response = $this->statusRequest(); |
|
76 | |||
77 | 18 | return $this->status |
|
78 | 18 | ->setResponse($response); |
|
79 | } |
||
80 | |||
81 | 3 | public function report(int $id): ReportInterface |
|
82 | { |
||
83 | 3 | $response = $this->captchAsIncorrect($id); |
|
84 | |||
85 | 3 | return $this->report |
|
86 | 3 | ->setResponse($response); |
|
87 | } |
||
88 | |||
89 | 21 | public function resolve($captcha): ResolveInterface |
|
90 | { |
||
91 | // If passed captcha id, retrieve captcha text |
||
92 | 21 | if (is_int($captcha)) { |
|
93 | 6 | $response = $this->retrieveCaptcha($captcha); |
|
94 | } else { |
||
95 | 15 | $image = ImageService::base64From($captcha); |
|
96 | |||
97 | 12 | $response = $this->uploadCaptcha($image); |
|
98 | } |
||
99 | |||
100 | 6 | return $this->resolve |
|
101 | 6 | ->setResponse($response); |
|
102 | } |
||
103 | |||
104 | public function resolveV2(string $mix, string $url = null): ResolveInterface |
||
105 | { |
||
106 | if (is_null($url)) { |
||
107 | $response = $this->retrieveCaptcha($mix); |
||
108 | } else { |
||
109 | $response = $this->sendReCaptchaV2($mix, $url); |
||
110 | } |
||
111 | |||
112 | return $this->resolve |
||
113 | ->setResponse($response); |
||
114 | } |
||
115 | } |
||
116 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.