Test Failed
Push — master ( 0cbd75...cf64e0 )
by Dmitry
02:49
created

CreateTaskResponse::getTaskId()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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