CreateTaskResponse::getTaskId()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 2
nc 2
nop 0
crap 6
1
<?php
2
3
namespace Anticaptcha\Response;
4
5
final class CreateTaskResponse extends AbstractResponse
6
{
7
    public ?int $taskId = null;
8
9
    public function getTaskId(): int
10
    {
11
        if (empty($this->taskId)) {
12
            throw new \RuntimeException('Response is failed.');
13
        }
14
15
        return $this->taskId;
16
    }
17
}
18